-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathloops.cpp
More file actions
65 lines (51 loc) · 916 Bytes
/
loops.cpp
File metadata and controls
65 lines (51 loc) · 916 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include<iostream>
using namespace std;
//to check a prime number
/*int main(){
int n,j;
int count=0;
cout<<"n is ";
cin>>n;
j=1;
while (j<=n){
if (n%j==0){
count++;
}
j=j+1;
}
if (count==2){
cout<<"prime number";
}
else{
cout<<"not prime";
}
return 0;
}*/
//sum of even number
/*int main(){
int n;
cout<<"enter a number ";
cin>>n;
int sum=0;
int j;
j=1;
while (j<=n){
if (j%2==0){
sum=sum+j;
}
j=j+1;
}
cout<<"the sum is "<<sum;
return 0;
}*/
//FAHRENHEIT AND CELCIUS
/*int main(){
int s,e,w;
cin>>s>>e>>w;
while (s<=e){
int temp=((5.0/9)*(s-32));
cout<<s<<" "<<temp<<endl;
s=s+w;
}
return 0;
}*/