Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

milestone 1 #162

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Abhishek jha/even or odd.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<iostream>
using namespace std;
int main()
{
int a;
cout<<"enter the number"<<endl;
cin>>a;
if(a/2==0)
{
cout<<"number is even";

}
else
cout<<"number is odd";
return 0;
}
20 changes: 20 additions & 0 deletions Abhishek jha/maximum.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include<iostream>
using namespace std;
int main()
{
int a,b;
cout<<"enter first number"<<endl;
cin>>a;
cout<<"enter second number"<<endl;
cin>>b;
if(a>b)
{
cout<<"greater numberis"<<a;
}

else
{
cout<<"greater number is "<<b;
}
return 0;
}
17 changes: 17 additions & 0 deletions Abhishek jha/milestone 2/absolute value.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include<iostream>
using namespace std;
int main()
{
int a,b;
cout<<"enter the integer "<<endl;
cin>>a;
if(a>=0)
{
cout<<"absolute value"<<a;

}
else
b=a*(-1);
cout<<"absolute value"<<b;
return 0;
}
50 changes: 50 additions & 0 deletions Abhishek jha/milestone 2/ages.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#include<iostream>
using namespace std;
int main()
{
int a1,a2,a3;
cout<<"enter the ages of three people respectively"<<endl;
cin>>a1;
cin>>a2;
cin>>a3;
if(a1>a2)
{
if(a2>=a3)
{cout<<"oldest"<<a1<<"youngest"<<a3;
}
if(a1>a3)
{
if(a2<=a3)
cout<<"oldest"<<a1<<"youngest"<<a2;
}
}
if(a2>a1)
{
if(a1>=a3)
{cout<<"oldest"<<a2<<"youngest"<<a3;
}
if(a1<a3)
{
if(a2>=a3)
cout<<"oldest"<<a2<<"youngest"<<a1;
}
}
if(a3>a1)
{
if(a1>=a2)
{cout<<"oldest"<<a3<<"youngest"<<a2;
}
if(a1<a2)
{
if(a3>=a1)
{cout<<"oldest"<<a3<<"youngest"<<a1;
}
}
}
if(a1==a2)
{
if(a2==a3)
cout<<"all three are equal";
}
return 0;
}
11 changes: 11 additions & 0 deletions Abhishek jha/milestone 2/alphabets.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include<iostream>
using namespace std;
int main()
{
char ch;
for(ch='a';ch<='z';ch++)
{
cout<<ch<<endl;
}
return 0;
}
22 changes: 22 additions & 0 deletions Abhishek jha/milestone 2/attendance.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include<iostream>
using namespace std;
int main()
{
int a,b,num,per;
cout<<"enter the number of class held"<<endl;
cin>>a;
cout<<"enter the number of class attended"<<endl;
cin>>b;
cout<<"percentage of class attended"<<endl;
num=b*100;
per=num/a;
cout<<per<<endl;
if(per<75)
{
cout<<"not allowed for examination"<<endl;
}
else
cout<<" allowe for examination"<<endl;
return 0;

}
19 changes: 19 additions & 0 deletions Abhishek jha/milestone 2/bonus.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include<iostream>
using namespace std;
int main()
{
int sal,yrs;
cout<<"enter the years of service"<<endl;
cin>>yrs;
cout<<"enter the salary"<<endl;
cin>>sal;
if(yrs>5)
{
cout<<"you will get bonus"<<endl;
cout<<" your bonus is"<<(sal*5)/100;

}
else
cout<<"no bonus";
return 0;
}
17 changes: 17 additions & 0 deletions Abhishek jha/milestone 2/count digi.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include<iostream>
using namespace std;
int main()
{
int n,num,a=0;
cout<<"enter the number"<<endl;
cin>>n;
while(n>0)
{
num=n/10;
n=num;
++a;
}
cout<<"the no. of digit are "<<a;
return 0;
}

17 changes: 17 additions & 0 deletions Abhishek jha/milestone 2/discount.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include<iostream>
using namespace std;
int main()
{
int a,amt,discount;
cout<<"enter the number of item purchases"<<endl;
cin>>a;
if(a>10)
{
cout<<"your purchase will have dicount of 10%"<<endl;
amt=(a*100)-(a*100)/10;
cout<<"price after discount "<<amt;
}
else
cout<<" total price is "<<a*100;
return 0;
}
19 changes: 19 additions & 0 deletions Abhishek jha/milestone 2/even upto 100.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include<iostream>
using namespace std;
int main()
{
int i=0,n;
cout<<"enter the number upto which even number have to print"<<endl;
cin>>n;

while(i<=n)
{
if(i%2==0)
{
cout<<i<<endl;
}
i++;

}
return 0;
}
22 changes: 22 additions & 0 deletions Abhishek jha/milestone 2/greater integer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include<iostream>
using namespace std;
int main()
{
int a,b;
cout<<"enter the value of first integer"<<endl;
cin>>a;
cout<<"enter the value of second integer "<<endl;
cin>>b;
if(a<b)
{
cout<<"greater number is"<<b;
}
else if(a==b)
{
cout<<"both are equal";

}
else
cout<<"greater integer is "<<a;
return 0;
}
37 changes: 37 additions & 0 deletions Abhishek jha/milestone 2/marks.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include<iostream>
using namespace std;
int main()
{
int marks;
cout<<"enter the marks obtained"<<endl;
cin>>marks;
if(marks<25)
{
cout<<"grade - F";
}
if(marks>=25)
{
if(marks<=45)
cout<<"grade - E";
}
if(marks>45)
{
if(marks<=50)
cout<<"grade - D";
}
if(marks>50)
{
if(marks<=60)
cout<<"grade - C";
}
if(marks>60)
{
if(marks<=80)
cout<<"grade - B";
}
if(marks>80)
{
cout<<"grade - A";
}
return 0;
}
30 changes: 30 additions & 0 deletions Abhishek jha/milestone 2/modified attendence.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include<iostream>
using namespace std;
int main()
{
int a,x,b,num,per;
cout<<"enter the number of class held"<<endl;
cin>>a;
cout<<"enter the number of class attended"<<endl;
cin>>b;
cout<<"percentage of class attended"<<endl;
num=b*100;
per=num/a;
cout<<per<<endl;
if(per<75)
{
cout<<"reason of absence is medical cause?(Y/N)"<<endl;
cin>>x;
if(x=='N')
{
cout<<"not allowed for examination"<<endl;
}
else
cout<<"allowed for examination"<<endl;
}
else
cout<<" allowed for examination"<<endl;
return 0;

}

14 changes: 14 additions & 0 deletions Abhishek jha/milestone 2/natural number upto n.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include<iostream>
using namespace std;
int main()
{
int i=0,n;
cout<<"enter the value upto which the series hav to be printed"<<endl;
cin>>n;
while(i<=n)
{
cout<<i<<endl;
i++;
}
return 0;
}
16 changes: 16 additions & 0 deletions Abhishek jha/milestone 2/od upto n.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<iostream>
using namespace std;
int main()
{
int i=0,n;
cout<<"Enter the upto which odd values have to found"<<endl;
cin>>n;
while(i<=n)
{
if(i%2!=0)
cout<<i<<endl;
i++;
}
return 0;

}
16 changes: 16 additions & 0 deletions Abhishek jha/milestone 2/reverse series from n.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<iostream>
using namespace std;
int main()
{
int i,n;
cout<<"enter the number the from which you have to see the series"<<endl;
cin>>n;
i=n;
while(i>=1)
{
cout<<i<<endl;
i--;

}
return 0;
}
17 changes: 17 additions & 0 deletions Abhishek jha/milestone 2/square.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include<iostream>
using namespace std;
int main()
{
int l,b;
cout<<"enter the value of length"<<endl;
cin>>l;
cout<<"enter the value of breadth"<<endl;
cin>>b;
if(l==b)
{
cout<<"its a square "<<endl;
}
else
cout<<"its not a square ";
return 0;
}
1 change: 1 addition & 0 deletions Abhishek jha/milestone 2/submissions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
submission
16 changes: 16 additions & 0 deletions Abhishek jha/milestone 2/sum of even.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<iostream>
using namespace std;
int main()
{
int a=0,n,m=0;
cout<<"enter the numberupto which even numbers have to be added"<<endl;
cin>>n;
while(a<=n)
{
if(a%2==0)
m=m+a;
a++;
}
cout<<m<<endl;
return 0;
}
Loading