forked from kunal-kushwaha/DSA-Bootcamp-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlow_Of_Program.cpp
More file actions
84 lines (69 loc) · 1.21 KB
/
Copy pathFlow_Of_Program.cpp
File metadata and controls
84 lines (69 loc) · 1.21 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
1.
#include<iostream>
using namespace std;
int main()
{
int year,s;
cout<<"Enter The Year: "<<endl;
cin>>year;
if(year%4==0)
{
if(year%100==0)
{
if(year%400==0)
cout<<"This is a loop year: "<<year;
else
cout<<"This is not a loop year: "<<year;
}
else
cout<<"This is a leap year: "<<year;
}
else
cout<<"This is not a leap year: "<<year;
return 0;
}
2.
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
cout<<"Enter the two numbers: "<<endl;
cin>>a>>b;
c=a+b;
cout<<"Your total sum is: "<<c;
}
3.
#include<iostream>
using namespace std;
int main()
{
int n,i;
cout<<"Enter the input from the user: ";
cin>>n;
for(i=1;i<=10; i++)
{
cout<<"Here table value is: "<<n*i<<endl;
}
}
4.
#include<iostream>
using namespace std;
int main()
{
int a,b,c,d,temp,hcf,lcm;
cout<<"Enter two values: "<<endl;
cin>>c>>d;
a=c;
b=d;
while(b!=0)
{
temp=b;
b=a%b;
a=temp;
}
hcf=a;
lcm=(c*d)/hcf;
cout<<"HCF: "<<hcf<<endl;
cout<<"LCM : "<<lcm<<endl;
}