Read OnLine Cpp Program Example



4 - LOOP CONCEPT
PRAC 5 PARC 6
//Wap To Print Table
#include<iostream.h>
#include<conio.h>
void main()
{
int i,n;
clrscr();
cout<<"Enter table number:";
cin>>n;
for (i=1;i<=10;i++)
{
cout<<"\n"<<i*n;
}
getch();
}
------output--------
Enter table number:4
4
8
12
16
20
24
28
32
36
40
//wap to print table number
#include<iostream.h>
#include<conio.h>
void main()
{
int i,n;
clrscr();
cin>>"Enter table number:";
cin>>n;
for (i=10;i>=1;i--)
{
cout<<"\n"<<i*n;
}
getch();
}
-----output-----
Enter table number:4
40
36
32
28
24
20
16
12
8
4
Previous Next
Download Download