-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSession3A.cpp
More file actions
45 lines (35 loc) · 811 Bytes
/
Session3A.cpp
File metadata and controls
45 lines (35 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include<iostream>
using namespace std;
int main(){
int num = 0;
int i = 111;
cout<<"Enter a Number:";
cin>>num;
/*cout<<num<<" "<<i<<"'s are "<<(num*i)<<"\n";
i++;
cout<<num<<" "<<i<<"'s are "<<(num*i)<<"\n";
i++;
cout<<num<<" "<<i<<"'s are "<<(num*i)<<"\n";
i++;
cout<<num<<" "<<i<<"'s are "<<(num*i)<<"\n";
i++;
cout<<num<<" "<<i<<"'s are "<<(num*i)<<"\n";*/
// in while loop, we check condition in beginning !!
while(i<=10){
cout<<num<<" "<<i<<"'s are "<<(num*i)<<"\n";
i++;
}
cout<<"Enter Number Again:";
cin>>num;
i = 111;
do{
cout<<num<<" "<<i<<"'s are "<<(num*i)<<"\n";
i++;
}while(i<=10); // in do while loop, we check condition in end !!
cout<<"Enter Number Again:";
cin>>num;
for(i=1;i<=10;i++){
cout<<num<<" "<<i<<"'s are "<<(num*i)<<"\n";
}
return 0;
}