Write a program to display the input

This is an ideal first program for learning "cin"
Two numbers are taken from the user and then displayed as output.

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. int a,b;
  7. cout<<"enter first no. ";
  8. cin>>a;
  9. //Coding by: Snehil Khanor
  10. //http://WapCPP.blogspot.com
  11. cout<<"enter second no. ";
  12. cin>>b;
  13. cout<<"First no. is "<<a;
  14. cout<<"\nSecond no.is "<<b;
  15. getch();
  16. }

Check out this stream