commit 70b71c4d97c78a1fbf55fd411e078323ebcf9bfe
parent 23a41b7b6757437bcc89112da998d0b411cb146d
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Sun, 28 Sep 2025 21:23:48 +0530
Add files via upload
Diffstat:
7 files changed, 56 insertions(+), 6 deletions(-)
diff --git a/Letusc-exercises/luc001.c b/Letusc-exercises/luc001.c
@@ -1,7 +1,7 @@
/* Temperature of a city in fahrenheit degrees is input through
the keyboard. WAP to convert this temperature into Centigrade
degrees. */
-/* Date : 13 sep, 2025 */
+/* Author - Amit Dutta, Date - 13 sep, 2025 */
/* Chapter 1; Page 19; Question NO.: F(a) */
#include<stdio.h>
diff --git a/Letusc-exercises/luc002.c b/Letusc-exercises/luc002.c
@@ -5,9 +5,10 @@ of the circle. */
/* Author - Amit Dutta, Date - 16th SEP, 2025 */
/* Let Us C; Page - 19; Chap- 1; QNo.: F(b) */
-#include<stdio.h>
-#include<math.h>
-int main() {
+#include <stdio.h>
+#include <math.h>
+int main()
+{
double len, bre, r, area_r, per, area_c, cir;
printf("Enter the length and breadth of the rectangle : ");
scanf("%lf %lf", &len, &bre);
diff --git a/Letusc-exercises/luc003.c b/Letusc-exercises/luc003.c
@@ -2,8 +2,10 @@
Each subsequent size A(n) is defined as A(n-1) cut in
half, parallel to its shorter sides. Thus, paper of
size A1 would have dimensions 841 mm x 594 mm. Write
-a program to calculate and print paper sizes A0,
-A1, A2, ... A8. */
+a program to calculate and print paper sizes A0,�
+A1,�A2,�...�A8. */
+/* Author - Amit Dutta, Date - 16th SEP, 2025 */
+/* Let Us C; Page - 19; Chap- 1; QNo.: F(c) */
#include<stdio.h>
#include<math.h>
diff --git a/Letusc-exercises/luc004.c b/Letusc-exercises/luc004.c
@@ -0,0 +1,26 @@
+/* If a five digit number is input through the keyboard,
+write a program to calculate the sum of it's digit.
+(Hint : Use the modulus operator %) */
+/* Author - Amit Dutta, Date - 28th SEP, 2025 */
+/* Let Us C; Page - 37; Chap- 2; QNo.: G(a) */
+
+#include <stdio.h>
+int main()
+{
+ int inp, result = 0, i, temp;
+ printf("Enter a five digit number : ");
+ scanf("%d", &inp);
+ if (inp < 10000 || inp > 99999)
+ {
+ printf("\nPlease enter a valid five digit number.");
+ return 1;
+ }
+ temp = inp;
+ for (i = 1; i <= 5; i++)
+ {
+ result = result + (inp % 10);
+ inp = inp / 10;
+ }
+ printf("\nSum of the digit '%d' is : %d", temp, result);
+ return 0;
+}+
\ No newline at end of file
diff --git a/Letusc-exercises/luc004.exe b/Letusc-exercises/luc004.exe
Binary files differ.
diff --git a/Letusc-exercises/luc005.c b/Letusc-exercises/luc005.c
@@ -0,0 +1,19 @@
+/* Write a program to recive Cartesian
+co-ordinates (x, y) of a point and convert
+them into Polar co-ordinates (r, phi)
+ Hint : r = sqrt (x^2 + y^2) and phi = tan^-1 (y/x) */
+/* Author - Amit Dutta, Date - 28th SEP, 2025 */
+/* Let Us C; Page - 37; Chap- 2; QNo.: G(b) */
+
+#include <stdio.h>
+#include <math.h>
+int main()
+{
+ double x, y, r, phi;
+ printf("Enter the Cartesian Co-Ordinates in this format 'x, y' : ");
+ scanf("%lf, %lf", &x, &y);
+ r = sqrt(pow(x, 2) + pow(y, 2));
+ phi = atan2(y, x);
+ printf("\nPolar Co-Ordinates are : (%g, %g Rad)", r, phi);
+ return 0;
+}+
\ No newline at end of file
diff --git a/Letusc-exercises/luc005.exe b/Letusc-exercises/luc005.exe
Binary files differ.