Search Your C Program

Tuesday, 24 January 2012

Program to Print the Sum of Two Numbers Input By User

#include<stdio.h>
void main()
{
int a,b,c;
printf("Enter the value of a : ");
scanf("%d",&a);
printf("Enter the value of b : ");
scanf("%d",&b);
c=a+b; //Subtraction, Multiplication and Division can also be done
printf("The sum of a and b = %d",c);
getch();
}

No comments:

Post a Comment