diff --git a/C/program-74/program.c b/C/program-74/program.c new file mode 100644 index 00000000..0c61fc16 --- /dev/null +++ b/C/program-74/program.c @@ -0,0 +1,15 @@ +#include + int main() +{ +int n, reverse=0, rem; +printf("Enter a number: "); + scanf("%d", &n); + while(n!=0) + { + rem=n%10; + reverse=reverse*10+rem; + n/=10; + } + printf("Reversed Number: %d",reverse); +return 0; +} \ No newline at end of file diff --git a/C/program-74/readme.md b/C/program-74/readme.md new file mode 100644 index 00000000..abdd17c1 --- /dev/null +++ b/C/program-74/readme.md @@ -0,0 +1 @@ +C Program to reverse a given number \ No newline at end of file diff --git a/C/program-79/program.c b/C/program-79/program.c new file mode 100644 index 00000000..1a3a9094 --- /dev/null +++ b/C/program-79/program.c @@ -0,0 +1,22 @@ +#include + +void main() +{ + printf("\n\n\t\tStudytonight - Best place to learn\n\n\n"); + float principal_amt, rate, simple_interest; + int time; + printf("Enter the value of principal amount, rate and time\n\n\n"); + scanf("%f%f%d", &principal_amt, &rate, &time); + + // considering rate is in percentage + simple_interest = (principal_amt*rate*time)/100.0; + + // usually used to align text in form of columns in table + printf("\n\n\t\t\tAmount = Rs.%7.3f\n ", principal_amt); + + printf("\n\n\t\t\tRate = Rs.%7.3f\n ", rate); + printf("\n\n\t\t\tTime= %d years \n", time); + printf("\n\n\t\t\tSimple Interest = Rs.%7.3f\n ", simple_interest); + printf("\n\n\t\t\tCoding is Fun !\n\n\n"); + return 0; +} \ No newline at end of file diff --git a/C/program-79/readme.md b/C/program-79/readme.md new file mode 100644 index 00000000..ec5e5b99 --- /dev/null +++ b/C/program-79/readme.md @@ -0,0 +1 @@ +C Program to calculate Simple Interest \ No newline at end of file