multiples of an integer – CSKC
Sign In

Search

Solved Problem #CPP#3070    siteicon   siteicon  

Problem Statement - multiples of an integer

Write a program to display 2nd, 4th and 6th multiple of the input integer number.

Solution

TC++ #3070

 

×

Ask AI About This Code

Default Prompt that is passed along with the code is given below, You can write your own prompt if you so desire.



×

Test CPP

  Related ( ? ) :

int n; cout<<“Enter an integer number :”; cin>>n;
A number from user is collected.

int m2=n*2;
int m4=n*4;
int m6=n*6;
Multiple are nothing but simple multiplication with the given multiple number.

cout<<“Second Multiple =”<<m2<<endl;
cout<<“Fourth Multiple =”<<m4<<endl;
cout<<“Sixth Multiple =”<<m6<<endl;
All the multiples are printed with simple cout instructions.


Share

Created: 26-Jan-2018 20:41 | Updated: 29-Nov-2018 17:21|