Learn C++ beginer programs

July 8, 2009

write a program to displat table of a number

Filed under: cin, cout, for loop, loop — snehilkhanor @ 1:40 pm
A number is taken from user and its table upto n is displayed.
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 n,m;
  7. cout<<”Please enter n: “;
  8. cin>>n;
  9. for (int i=1;i<=10;i++)
  10. {
  11. m=n*i;
  12. cout<<n<<”*”<<i<<”=”<<m<<endl;
  13. }
  14. getch();
  15. }

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.