Sample – Program to enter an integer and output its 15 multiples.

by Nideesh C on February 8, 2011 · 0 comments

in C++




#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.

Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. Sample – Program to enter an integer and output the cube of that integer.
  2. Sample – Program to enter three integers and output the biggest integer using IF
  3. Sample – Program to enter three integers and output the biggest integer.
  4. Sample – Program to enter an integer and print out its successor.
  5. Sample – Program to enter an integer and find out if it is even or odd.

Leave a Comment

Previous post:

Next post: