rabbinur

Loop Basic

Aug 9th, 2012
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include<iostream.h>
  2. //#include<stdio.h>
  3. #include<fstream.h>
  4. #include<stdlib.h>
  5. #include<conio.h>
  6. void main()
  7. {
  8. int a, b, c, sum;
  9. clrscr();
  10. //printf("Enter 2 integers to add:""\n");
  11. cout<<"Enter 2 integers to add:""\n";
  12. cin>>a>>b;
  13.  
  14. //Summation calculation starts.
  15. c=a+b;
  16. cout<<"The sum of "<<a<<" and "<<b<<" is "<<c<<"."<<endl;
  17. b=c-a;
  18. cout<<"Subtraction from "<<c<<" to "<<a<<" is "<<b<<endl;
  19. a=c-b;
  20. //End of summation calc...
  21.  
  22.  
  23. cout<<"The sum of "<<a<<" and "<<c<<" is "<<b<<"."<<endl;
  24. cout<<"The sum of "<<b<<" and "<<c<<" is "<<a<<"."<<endl;
  25.  
  26. getch();
  27. }
Advertisement
Add Comment
Please, Sign In to add comment