Here you will get simple C program to add two numbers.
User will input two numbers, then their sum will be calculated and finally it will be printed on screen.
The program is given below.
C Program to Add Two Numbers
#include<stdio.h> int main() { int a,b,sum; printf("Enter first number:"); scanf("%d",&a); printf("Enter second number:"); scanf("%d",&b); sum=a+b; printf("\nSum=%d",sum); return 0; }
Output
Enter first number:4
Enter second number:8
Sum=12
can u reply me a C program to reverse a string in my gmail
Nice explanation bro. Can you explain about leap year concept. Please reply.