Tuesday, 20 March 2012

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


/*perform subtraction of two integer without using Minus (" -- ") operator*/
//for positive output use if condition this code will show negative output


#include<stdio.h>


void main()
 {
          int a=10,b=20;
          while(b--) //start decrement b and also decrese a also
          {
            a-- ;
          }     
    printf("Sum of two number is=>%d",a); 
 } 

No comments:

Post a Comment

Compiler for C,C++ and Python {paste your programme to see the output}