Social Icons

Tuesday, 25 March 2014

C Program to Subtract two numbers without using subtract (-) operator

#include<stdio.h>
#include<conio.h>
main()
{
int a, b,c;
clrscr();
printf("\n Enter first number : ");
scanf("%d",&a);
printf("\n Enter first number : ");
scanf("%d",&b);
c = a + ~b + 1;
printf("\n\t The Addition of a and b is : %d ",c);
getch();
}

                                                      OUTPUT

No comments:

Post a Comment