Skip to content

Commit 55b607c

Browse files
authored
Create add_int.c
1 parent f549ffa commit 55b607c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

codes/add_int.c

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// This is program for adding two numbers of integer type.
2+
3+
/* sample input:
4+
Enter the first number: 2
5+
Enter the second number: 5
6+
sample output:
7+
The sum is 7
8+
*/
9+
10+
#include <stdio.h> //This file is to be included from library of c which is standard input output function.
11+
void main()
12+
{
13+
int num1 , num2 , result; // declaration of variables
14+
15+
printf("Enter the first number:");
16+
scanf("%d",&num1); // input first number
17+
18+
printf("Enter the second number:");
19+
scanf("%d",&num2); // input second number
20+
21+
result = num1 + num2 ; // adding both numbers
22+
23+
printf("The sum is %d ",result); // output result
24+
25+
26+
}

0 commit comments

Comments
 (0)