Thursday, 28 August 2014

Write a program to add two numbers.

SOURCE CODE

//WAP to add two numbers.

#include<stdio.h>
#include<conio.h>
void main()
{
    int a, b, sum ;
   printf("ADD TWO NUMBERS\n\n") ;
   printf("Enter the value of A : ") ;
   scanf("%d", &a) ;
   printf("Enter the value of b : ") ;
   scanf("%d", &b) ;
   sum=a+b ;
   printf("\nThe sum of %d and %d is %d.", a,b,sum) ;
   getch() ;
}


SCREENSHOT


No comments:

Post a Comment