Sunday, August 23, 2015

Upto 5 Multiples of Any Number - While Loop


Q. 90. Program to print upto 5 multiples of any number using "while" loop.

Copy Code:


#include <iostream>

using namespace std;

int main()

{

  int a, i=1;

  cout << "Enter a number: ";
  
  cin >> a;

  while(i<=5)

  {

     cout << a << " * " << i << " = " <<a * i << "\n";

     ++i; 

  }

return 0;

}

No comments:

Post a Comment