Q. Write a program to add two numbers?
Ans.
#include<stdio.h>
#include<conio.h>
void main()
{
 int a,b,sum;
 clrscr();
 printf("Enter Numbers a and b : ");
 scnaf("%d%d",&a,&b);
 sum=a+b;
 printf("\nsum(a+b)=%d",sum);
getch();
getch();
}
     Output of above program : 
Enter Numbers a and b : 100
200
sum(a+b)=300
 
No comments:
Post a Comment