Pages

Wednesday, April 9, 2014

Add two numbers

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("
sum(a+b)=%d"
,sum);

 getch();
}

     Output of above program : 

Enter Numbers a and b : 100
200

sum(a+b)=300

Related Posts by Categories

0 comments:

Post a Comment