From d1ad1976703aa294157e4eadf1f074a9b1777d82 Mon Sep 17 00:00:00 2001 From: UdaySantoshKumar <75845600+udaysk3@users.noreply.github.com> Date: Tue, 5 Oct 2021 20:42:08 +0530 Subject: [PATCH 1/4] Add files via upload --- C/program-74/program.c | 15 +++++++++++++++ C/program-74/readme.md | 1 + 2 files changed, 16 insertions(+) create mode 100644 C/program-74/program.c create mode 100644 C/program-74/readme.md 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 From 328d8f0215d54313b96a2a6619fd4c8bb37df014 Mon Sep 17 00:00:00 2001 From: UdaySantoshKumar <75845600+udaysk3@users.noreply.github.com> Date: Tue, 5 Oct 2021 20:49:44 +0530 Subject: [PATCH 2/4] ADDED 77TH NEW PROGRAM --- C/program-77/program.c | 51 ++++++++++++++++++++++++++++++++++++++++++ C/program-77/readme.md | 1 + 2 files changed, 52 insertions(+) create mode 100644 C/program-77/program.c create mode 100644 C/program-77/readme.md diff --git a/C/program-77/program.c b/C/program-77/program.c new file mode 100644 index 00000000..7dcefe58 --- /dev/null +++ b/C/program-77/program.c @@ -0,0 +1,51 @@ +#include + +int main() +{ +int m, n, p, q, c, d, k, sum = 0; +int mat1[10][10], mat2[10][10], mat3[10][10]; + +printf(“Enter number of rows and columns of mat1 matrix\n”); +scanf(“%d%d”, &m, &n); +printf(“Enter elements of matrix 1\n”); + +for (c = 0; c < m; c++) +for (d = 0; d < n; d++) +scanf(“%d”, &mat1[c][d]); + +printf(“\nEnter number of rows and columns of mat2 matrix\n”); +scanf(“%d%d”, &p, &q); + +if (n != p) +printf(“\nThe matrices can’t be multiplied with each other.\n”); +else +{ +printf(“\nEnter elements of matrix2\n”); + +for (c = 0; c < p; c++) +for (d = 0; d < q; d++) +scanf(“%d”, &mat2[c][d]); + +for (c = 0; c < m; c++) { +for (d = 0; d < q; d++) { +for (k = 0; k < p; k++) { +sum = sum + mat1[c][k]*mat2[k][d]; +} + +mat3[c][d] = sum; +sum = 0; +} +} + +printf(“\nProduct of the matrices:\n”); + +for (c = 0; c < m; c++) { +for (d = 0; d < q; d++) +printf(“%d\t”, mat3[c][d]); + +printf(“\n”); +} +} + +return 0; +} \ No newline at end of file diff --git a/C/program-77/readme.md b/C/program-77/readme.md new file mode 100644 index 00000000..41afd4c7 --- /dev/null +++ b/C/program-77/readme.md @@ -0,0 +1 @@ +C program to multiply matrices \ No newline at end of file From af9ebf743ec45651ce1292c7c12ad1c4abcbab78 Mon Sep 17 00:00:00 2001 From: UdaySantoshKumar <75845600+udaysk3@users.noreply.github.com> Date: Tue, 5 Oct 2021 20:50:51 +0530 Subject: [PATCH 3/4] ADDED 78TH NEW PROGRAM --- C/program-78/program.c | 24 ++++++++++++++++++++++++ C/program-78/readme.md | 1 + 2 files changed, 25 insertions(+) create mode 100644 C/program-78/program.c create mode 100644 C/program-78/readme.md diff --git a/C/program-78/program.c b/C/program-78/program.c new file mode 100644 index 00000000..c82cb20b --- /dev/null +++ b/C/program-78/program.c @@ -0,0 +1,24 @@ +#include + +int main() +{ + printf("\n\n\t\tStudytonight - Best place to learn\n\n\n"); + int h, b; + float area; + printf("\n\nEnter the height of the Triangle: "); + scanf("%d", &h); + printf("\n\nEnter the base of the Triangle: "); + scanf("%d", &b); + + /* + Formula for the area of the triangle = (height x base)/2 + + Also, typecasting denominator from int to float + to get the output in float + */ + area = (h*b)/(float)2; + printf("\n\n\nThe area of the triangle is: %f", area); + + printf("\n\n\t\t\tCoding is Fun !\n\n\n"); + return 0; +} \ No newline at end of file diff --git a/C/program-78/readme.md b/C/program-78/readme.md new file mode 100644 index 00000000..e8e927d0 --- /dev/null +++ b/C/program-78/readme.md @@ -0,0 +1 @@ +C Program to find the Area of Triangle using Base and Height \ No newline at end of file From 7bd939f8e9586c6aabfd1889ce17354b666c5172 Mon Sep 17 00:00:00 2001 From: UdaySantoshKumar <75845600+udaysk3@users.noreply.github.com> Date: Tue, 5 Oct 2021 20:53:54 +0530 Subject: [PATCH 4/4] added 79th program --- C/program-79/program.c | 22 ++++++++++++++++++++++ C/program-79/readme.md | 1 + 2 files changed, 23 insertions(+) create mode 100644 C/program-79/program.c create mode 100644 C/program-79/readme.md 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