-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
IOT/Nivedita-R_NiveditaRai_2125it1079_2/Getting Started/Hello.txt
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
IOT/Nivedita-R_NiveditaRai_2125it1079_2/GettingStarted/CountDigitsInANumber.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <iostream> | ||
#include<cmath> | ||
using namespace std; | ||
|
||
int main(){ | ||
int n; | ||
cin >> n; | ||
if(n>=1 && n<=pow(10.0,9.0)){ | ||
int d=0; | ||
while(n!=0) | ||
{ | ||
n=n/10; | ||
d++; | ||
} | ||
cout<<d; | ||
} | ||
return 0; | ||
} |
22 changes: 22 additions & 0 deletions
22
IOT/Nivedita-R_NiveditaRai_2125it1079_2/GettingStarted/GradingSystem.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
int main() | ||
{ | ||
int a; | ||
cin>>a; | ||
if(a>90) | ||
cout<<"excellent"<<endl; | ||
else if(a<=90 && a>80) | ||
cout<<"good"<<endl; | ||
else if(a>70 && a<=80) | ||
cout<<"fair"<<endl; | ||
else if(a>60 && a<=70) | ||
cout<<"meets expectations"<<endl; | ||
else | ||
cout<<"below par"<<endl; | ||
|
||
|
||
return 0; | ||
} |
31 changes: 31 additions & 0 deletions
31
IOT/Nivedita-R_NiveditaRai_2125it1079_2/GettingStarted/IsANumberPrime.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <iostream> | ||
#include<cmath> | ||
using namespace std; | ||
int main(){ | ||
int t,i,j,n,c; | ||
cin >> t; | ||
if(t>=1 && t<=10000) | ||
{ | ||
for (i=0;i<t;i++) | ||
{ | ||
c=0; | ||
cin>>n; | ||
if(n>=2 && n<=pow(10,9)) | ||
{ | ||
|
||
for(j=1;j<=n;j++) | ||
{ | ||
if(n%j==0) | ||
c++; | ||
|
||
} | ||
if(c==2) | ||
cout<<"prime"<<endl; | ||
else | ||
cout<<"not prime"<<endl; | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
IOT/Nivedita-R_NiveditaRai_2125it1079_2/GettingStarted/PrintAllPrimesTillN.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <iostream> | ||
#include<cmath> | ||
using namespace std; | ||
int main(int argc, char **argv){ | ||
int low, high, i,j,c=0; | ||
cin >> low >> high; | ||
for(i=low;i<=high;i++) | ||
{c=0; | ||
for(j=2;j<=sqrt(i);j++) | ||
{ | ||
if(i%j==0) | ||
c++; | ||
} | ||
if(c==0) | ||
cout<<i<<endl; | ||
} | ||
return 0; | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
IOT/Nivedita-R_NiveditaRai_2125it1079_2/GettingStarted/PrintFibonacciNumbersTillN.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
int n,c; | ||
cin >> n; | ||
int a=0,b=1; | ||
cout<<a<<endl<<b<<endl; | ||
for(int i=0;i<n-2;i++) | ||
{ | ||
c=a+b; | ||
cout<<c<<endl; | ||
a=b; | ||
b=c; | ||
} | ||
|
||
|
||
} |
29 changes: 29 additions & 0 deletions
29
IOT/Nivedita-R_NiveditaRai_2125it1079_2/GettingStarted/PrintZ.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
int main() | ||
{ | ||
int i,j,k; | ||
for(i=0;i<5;i++) | ||
{ | ||
for(j=4;j>=0;j--) | ||
{ | ||
if(i==0 || i==4) | ||
cout<<"*"; | ||
else | ||
{ | ||
if(i==j) | ||
cout<<"*"; | ||
else | ||
cout<<" "; | ||
} | ||
|
||
} | ||
cout<<endl; | ||
} | ||
|
||
return 0; | ||
} | ||
|