Tuesday 1 October 2013

C PROGRAM TO FIND TWO NUMBERS FROM THE SUM AND DIFFERENCE OF THE TWO NUMBERS

#include<stdio.h>
void main()
{
int a,b;
clrscr();
printf("Enter the sum of two numbers\n");
scanf("%d",&a);
printf("Enter the difference of two numbers\n");
scanf("%d",&b);
{
printf("1st.no=%d\n",(a+b)/2);
printf("2nd.no=%d\n",(a-((a+b)/2)));
}
getch();
}

No comments:

Post a Comment