Addtion of two integer C Program

C Program is given to add two integer. Two add two numbers, we use + arithmetic operator.

#include<stdio.h>
int main()
{
 int a,b;
 printf("Enter first number: ");
 scanf("%d",&a);
 printf("Enter second number: ");
 scanf("%d",&b);
 int c=a+b;
 printf("Addition of %d and %d is %d\n",a,b,c);
 return 0;
}
 
 





Addition of two integer using function

#include<stdio.h>
int Addition(int a,int b)
{
 int c=a+b;
 return c;
}
int main()
{
 int a,b;
 printf("Enter first number: ");
 scanf("%d",&a);
 printf("Enter second number: ");
 scanf("%d",&b);
 int c=Addition(a,b);
 printf("Addition of %d and %d is %d",a,b,c);
 return 0;
}

Popular posts from this blog