We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f549ffa commit 55b607cCopy full SHA for 55b607c
codes/add_int.c
@@ -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