Program to enter an integer and output its 15 multiples

Join Our Official Freshers Jobs Telegram Channel

 

#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.
INPUT :
12
OUTPUT :
The first 15 multiples of 12 are :
12×1=12
12×2=24
12×3=3612×4=48
12×5=60
12×6=72
12×7=84
12×8=96
12×9=108
12×10=120
12×11=132
12×12=144
12×13=156
12×14=168
12×15=180