Entri Populer

Selasa, 25 Januari 2011

Program to enter an integer and output its 15 multiples


#include <iostream.h>
#include <conio.h>
int main()
{
clrscr();
int x;
cout << "Enter an integer less than 2185 : ";
cin>>x;
cout << "The first 15 multiples of " << x << " are : ";
for(int y=1;y<16;y++)
cout << "\n" << x << "x" << y << "=" << x*y;
getch();
return 0;
}
This program takes in an integer x as a screen input from the user.
It then calculates the first fifteen multiples of that integer and outputs it using the 'cout' command.

Tidak ada komentar:

Posting Komentar