Write a C program to get the sum of two digit?
#include<stdio.h>
main()
{
int a,b sum=0;
printf("Enter the first number : ");
scanf("%d",&a);
printf("Enter the second number : ");
scanf("%d",&b);
sum=a+b;
printf("Sum = %d ",sum);
return0;
}
main()
{
int a,b sum=0;
printf("Enter the first number : ");
scanf("%d",&a);
printf("Enter the second number : ");
scanf("%d",&b);
sum=a+b;
printf("Sum = %d ",sum);
return0;
}
Output : -
Enter the first number : 5
Enter the second number : 6
Sum = 11
Enter the second number : 6
Sum = 11
No comments