Skip to content

Commit

Permalink
module1
Browse files Browse the repository at this point in the history
my first module of programs
  • Loading branch information
Nivedita-R authored and devAyushDubey committed Oct 4, 2022
1 parent 64e39d0 commit e795c3f
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 1 deletion.

This file was deleted.

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;
}
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;
}
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;
}
}

}

}
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;

}
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 IOT/Nivedita-R_NiveditaRai_2125it1079_2/GettingStarted/PrintZ.cpp
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;
}

0 comments on commit e795c3f

Please sign in to comment.