From ea56e3be812d7ab120b3b7d69d9bf38f2088123a Mon Sep 17 00:00:00 2001 From: 22BCAD09anusha Date: Sun, 26 May 2024 11:45:48 +0530 Subject: [PATCH 1/3] first commit --- new.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 new.c diff --git a/new.c b/new.c new file mode 100644 index 0000000..c8b7f7b --- /dev/null +++ b/new.c @@ -0,0 +1,14 @@ +#include +int main() { + + int number1, number2, sum; + + printf("Enter two integers: "); + scanf("%d %d", &number1, &number2); + + // calculate the sum + sum = number1 + number2; + + printf("%d + %d = %d", number1, number2, sum); + return 0; +} From 83ea53db49f17b2e66641e04e04b7e7d09146cb7 Mon Sep 17 00:00:00 2001 From: 22BCAD09anusha Date: Sun, 26 May 2024 17:45:16 +0530 Subject: [PATCH 2/3] first commit --- multi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 multi.c diff --git a/multi.c b/multi.c new file mode 100644 index 0000000..f646d2f --- /dev/null +++ b/multi.c @@ -0,0 +1,14 @@ +#include +int main() { + double a, b, product; + printf("Enter two numbers: "); + scanf("%lf %lf", &a, &b); + + // Calculating product + product = a * b; + + // %.2lf displays number up to 2 decimal point + printf("Product = %.2lf", product); + + return 0; +} From 9af21ddf5bf3ef860652cc563a50eea7cc6d63c6 Mon Sep 17 00:00:00 2001 From: Anusha Hegde <155943368+22BCAD09anusha@users.noreply.github.com> Date: Sun, 26 May 2024 17:58:04 +0530 Subject: [PATCH 3/3] Update multi.c --- multi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multi.c b/multi.c index f646d2f..a2e0096 100644 --- a/multi.c +++ b/multi.c @@ -2,7 +2,7 @@ int main() { double a, b, product; printf("Enter two numbers: "); - scanf("%lf %lf", &a, &b); + scanf("%lf %lf", &a, &b) // Calculating product product = a * b;