{"id":26986659,"url":"https://github.com/syntaxrender/c-programs","last_synced_at":"2025-04-03T19:19:06.546Z","repository":{"id":267341405,"uuid":"900929759","full_name":"SyntaxRender/C-Programs","owner":"SyntaxRender","description":"C-Programming Applications","archived":false,"fork":false,"pushed_at":"2025-02-18T19:15:37.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T19:19:03.378Z","etag":null,"topics":["c-lang","c-programming"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SyntaxRender.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-09T18:21:50.000Z","updated_at":"2025-02-18T19:16:53.000Z","dependencies_parsed_at":"2024-12-09T20:21:49.558Z","dependency_job_id":"15664bb0-6230-4b42-9fca-bd87c8834e28","html_url":"https://github.com/SyntaxRender/C-Programs","commit_stats":null,"previous_names":["joblessgod/c-programs","syntaxrender/c-programs"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyntaxRender%2FC-Programs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyntaxRender%2FC-Programs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyntaxRender%2FC-Programs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyntaxRender%2FC-Programs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SyntaxRender","download_url":"https://codeload.github.com/SyntaxRender/C-Programs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247061882,"owners_count":20877176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-lang","c-programming"],"created_at":"2025-04-03T19:19:06.033Z","updated_at":"2025-04-03T19:19:06.537Z","avatar_url":"https://github.com/SyntaxRender.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Interest Calculation and Reverse Number Program\n\n## Description\nThis repository contains two programs:\n1. **Simple Interest Calculation**: Calculates the simple interest based on given Principle (P), Time (T), and Rate (R).\n2. **Reverse Number**: Reverses the digits of an integer.\n\n## Programs\n\n### 1. Simple Interest Calculation Program\n\n#### Formula:\n```\nSimple Interest = (P * T * R) / 100\n```\n\n#### Code:\n```c\n#include\u003cstdio.h\u003e\n\nint main () {\n    float P, T, R, SimpleInterest;\n\n    // Prompt the user to enter Principle, Time, and Rate\n    printf(\"Enter Principle(NPR), Time(Years), Rate(Percentage): \");\n    scanf(\"%f%f%f\", \u0026P, \u0026T, \u0026R);\n\n    // Calculate Simple Interest\n    SimpleInterest = P * T * R / 100;\n\n    // Output the result with proper formatting\n    printf(\"\\nPrinciple: NPR %.2f\\nTime: %.f Year\\nRate: %.f %% \\nSimple Interest: NPR %.2f\\n\", P, T, R, SimpleInterest);\n\n    getchar(); // Consume the newline character left in the buffer\n    getchar(); // Wait for user input before closing\n\n    return 0;\n}\n```\n\n#### Explanation:\n- **Principle (P):** The initial amount of money in NPR (Nepalese Rupees).\n- **Time (T):** The duration for which the money is borrowed or invested (in years).\n- **Rate (R):** The interest rate (percentage) per year.\n- **Simple Interest Calculation:** Formula used to calculate interest based on the input values.\n\n### 2. Reverse Number Program\n\n#### Code:\n```c\n#include \u003cstdio.h\u003e\n\nint main() {\n    int number, reverse = 0;\n    printf(\"Enter a number: \");\n    scanf(\"%d\", \u0026number);\n\n    while (number != 0) {\n        reverse = reverse * 10 + number % 10;\n        number /= 10;\n    }\n\n    printf(\"Reversed number: %d\\n\", reverse);\n    return 0;\n}\n```\n\n#### Explanation:\n- **Input:** The user inputs a number (integer).\n- **Reverse Logic:** \n   - The last digit is obtained using the modulus operator (`% 10`).\n   - This digit is added to the `reverse` variable, which is multiplied by 10 to shift the digits left.\n   - The last digit is removed from the `number` using integer division (`/ 10`).\n- **Output:** The program displays the reversed number.\n\n## Example Outputs\n\n### Simple Interest Calculation:\n\n**Input:**\n```\nEnter Principle(NPR), Time(Years), Rate(Percentage): 10000 5 10\n```\n\n**Output:**\n```\nPrinciple: NPR 10000.00\nTime: 5 Year\nRate: 10 %\nSimple Interest: NPR 5000.00\n```\n\n### Reverse Number:\n\n**Input:**\n```\nEnter a number: 12345\n```\n\n**Output:**\n```\nReversed number: 54321\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntaxrender%2Fc-programs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyntaxrender%2Fc-programs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntaxrender%2Fc-programs/lists"}