From 38dc5e71ff47ffc99ef9fc96230841aa92be3e96 Mon Sep 17 00:00:00 2001 From: 22bcad09anusha Date: Mon, 8 Apr 2024 11:38:02 +0530 Subject: [PATCH 1/2] added file --- add.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 add.c diff --git a/add.c b/add.c new file mode 100644 index 0000000..a5170b6 --- /dev/null +++ b/add.c @@ -0,0 +1,26 @@ +#include + +int main() +{ + // Declare variables + int num1,num2,sum; + + + + printf("Enter two integers: "); + + scanf("%d %d", &num1, &num2); + + + + // calculate the sum of two numbers + + sum = num1 + num2; + + + + // Print the result + + printf("%d + %d = %d", num1, num2, sum); + return 0; +} \ No newline at end of file From 09c7cd37e820b624ffdf8a898c67a415f3ccf4d2 Mon Sep 17 00:00:00 2001 From: Anusha Hegde <155943368+22BCAD09anusha@users.noreply.github.com> Date: Mon, 8 Apr 2024 11:41:54 +0530 Subject: [PATCH 2/2] Update add.c --- add.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/add.c b/add.c index a5170b6..7aa858b 100644 --- a/add.c +++ b/add.c @@ -3,7 +3,7 @@ int main() { // Declare variables - int num1,num2,sum; + int num1,num2,s; @@ -15,12 +15,12 @@ int main() // calculate the sum of two numbers - sum = num1 + num2; + s = num1 + num2; // Print the result - printf("%d + %d = %d", num1, num2, sum); - return 0; -} \ No newline at end of file + printf("%d + %d = %d", num1, num2, s); + +}