Write a program to calculate sum of two numbers

Two numbers are taken from the user and sum is calculated.

Select To use this code as it is.. select and copy paste this code into code.cpp file :)



  1. #include <iostream.h>
  2. #include <conio.h>
  3. void main()
  4. {
  5. clrscr();
  6. float a,b,s;
  7. cout<<"Please enter a no.: ";
  8. cin>>a;
  9. //Coding by: Snehil Khanor
  10. //http://WapCPP.blogspot.com
  11. cout<<"Please enter another no.: ";
  12. cin>>b;
  13. s=a+b;
  14. cout<<"The sum is: "<<s;

  15. getch();
  16. }

Check out this stream