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 11 completed #175

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added Aparna GCI/GCI milestone 3/c2.exe
Binary file not shown.
6 changes: 6 additions & 0 deletions Cherish Sachdeva/Milestone 1/Practice_1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"Welcome to Girl Code It"<<endl;
return 0;
}
Binary file added Cherish Sachdeva/Milestone 1/Practice_1.exe
Binary file not shown.
10 changes: 10 additions & 0 deletions Cherish Sachdeva/Milestone 1/Practice_2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a;
cin>>b;
int c=a>b?a:b;
cout<<"The maximum number is : "<<c<<endl;
return 0;
}
Binary file added Cherish Sachdeva/Milestone 1/Practice_2.exe
Binary file not shown.
9 changes: 9 additions & 0 deletions Cherish Sachdeva/Milestone 1/Practice_3.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include<bits/stdc++.h>
using namespace std;
int main(){
int num;
cin>>num;
string ans=num%2==0?"even":"odd";
cout<<num<<" is "<<ans;
return 0;
}
Binary file added Cherish Sachdeva/Milestone 1/Practice_3.exe
Binary file not shown.
14 changes: 14 additions & 0 deletions Cherish Sachdeva/Milestone 1/Practice_4.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include<bits/stdc++.h>
using namespace std;
int main(){
int num;
cin>>num;
if(num>0){
cout<<num<<" is postive"<<endl;
}else if(num<0){
cout<<num<<" is negative"<<endl;
}else{
cout<<num<<" is zero"<<endl;
}
return 0;
}
Binary file added Cherish Sachdeva/Milestone 1/Practice_4.exe
Binary file not shown.
11 changes: 11 additions & 0 deletions Cherish Sachdeva/Milestone 1/Practice_5.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include<bits/stdc++.h>
using namespace std;
int main(){
int num1,num2,ans;
cin>>num1;
cin>>num2;
ans=num1*num2;
cout<<"Multiplication of "<<num1<<" & "<<num2<<" is "<<ans;
return 0;

}
Binary file added Cherish Sachdeva/Milestone 1/Practice_5.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions Cherish Sachdeva/Milestone 1/inputf.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-3
2
1 change: 1 addition & 0 deletions Cherish Sachdeva/Milestone 1/outputf.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Multiplication of -3 & 2 is -6
14 changes: 14 additions & 0 deletions Cherish Sachdeva/Milestone 10/1/Level1/Practice1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include<bits/stdc++.h>
using namespace std;
int sum(int a,int b){
int sum;
sum=a+b;
return sum;
}
int main(){
int a,b;
cin>>a;
cin>>b;
cout<<sum(a,b);
return 0;
}
Binary file not shown.
14 changes: 14 additions & 0 deletions Cherish Sachdeva/Milestone 10/1/Level1/Practice2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include<bits/stdc++.h>
using namespace std;
int prod(int a,int b){
int p;
p=a*b;
return p;
}
int main(){
int a,b;
cin>>a;
cin>>b;
cout<<prod(a,b);
return 0;
}
Binary file not shown.
19 changes: 19 additions & 0 deletions Cherish Sachdeva/Milestone 10/1/Level1/Practice3.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include<bits/stdc++.h>
using namespace std;
int area(int r){
int A;
A=(22*r*r)/7;
return A;
}
int circumference(int r){
int C;
C=(2*22*r)/7;
return C;
}
int main(){
int r;
cin>>r;
cout<<"Area of crcle is "<<area(r)<<endl;
cout<<"Circumference of circle is "<<circumference(r)<<endl;
return 0;
}
Binary file not shown.
25 changes: 25 additions & 0 deletions Cherish Sachdeva/Milestone 10/1/Level1/Practice4.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include<bits/stdc++.h>
using namespace std;
int max(int a,int b,int c){
if(a>b){
if(a>c){
return a;
}else{
return c;
}
}else{
if(b>c){
return b;
}else{
return c;
}
}
}
int main(){
int a,b,c;
cin>>a;
cin>>b;
cin>>c;
cout<<"Max is "<<max(a,b,c);
return 0;
}
Binary file not shown.
19 changes: 19 additions & 0 deletions Cherish Sachdeva/Milestone 10/1/Level1/Practice5.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include<bits/stdc++.h>
using namespace std;
bool type(int n){
if(n%2==0){
return true;
}else{
return false;
}
}
int main(){
int a;
cin>>a;
if(type(a)){
cout<<"Even";
}else{
cout<<"Odd";
}
return 0;
}
Binary file not shown.
19 changes: 19 additions & 0 deletions Cherish Sachdeva/Milestone 10/1/Level1/Practice6.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include<bits/stdc++.h>
using namespace std;
bool vote(int n){
if(n>=18){
return true;
}else{
return false;
}
}
int main(){
int n;
cin>>n;
if(vote(n)){
cout<<"Eligible to vote"<<endl;
}else{
cout<<"Not Eligible to vote"<<endl;
}
return 0;
}
Binary file not shown.
20 changes: 20 additions & 0 deletions Cherish Sachdeva/Milestone 10/1/Level1/Practice7.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include<bits/stdc++.h>
using namespace std;
bool prime(int n){
for(int i=2;i<n;i++){
if(n%i==0){
return false;
}
}
return true;
}
int main(){
int x;
cin>>x;
if(prime(x)){
cout<<"Prime";
}else{
cout<<"Non-Prime";
}
return 0;
}
Binary file not shown.
25 changes: 25 additions & 0 deletions Cherish Sachdeva/Milestone 10/1/Level1/Practice8.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include<bits/stdc++.h>
using namespace std;
void grades(int n){
if(n>=91 && n<=100){
cout<<"AA";
}else if(n>=81 && n<=90){
cout<<"AB";
}else if(n>=71 && n<=80){
cout<<"BB";
}else if(n>=61 && n<=70){
cout<<"BC";
}else if(n>=51 && n<=60){
cout<<"CD";
}else if(n>=41 && n<=50){
cout<<"DD";
}else{
cout<<"Fail";
}
}
int main(){
int marks;
cin>>marks;
grades(marks);
return 0;
}
Binary file not shown.
15 changes: 15 additions & 0 deletions Cherish Sachdeva/Milestone 10/1/Level1/Practice9.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include<bits/stdc++.h>
using namespace std;
int factorial(int n){
int fac=1;
for(int i=1;i<=n;i++){
fac*=i;
}
return fac;
}
int main(){
int x;
cin>>x;
cout<<factorial(x)<<endl;
return 0;
}
Binary file not shown.
1 change: 1 addition & 0 deletions Cherish Sachdeva/Milestone 10/1/Level1/inputf.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3
1 change: 1 addition & 0 deletions Cherish Sachdeva/Milestone 10/1/Level1/outputf.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6
11 changes: 11 additions & 0 deletions Cherish Sachdeva/Milestone 10/2/1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include<bits/stdc++.h>
using namespace std;
int main(){
int i,t;
cin>>i;
while(i--){
cin>>t;
cout<<t<<endl;
}
return 0;
}
Binary file added Cherish Sachdeva/Milestone 10/2/1.exe
Binary file not shown.
13 changes: 13 additions & 0 deletions Cherish Sachdeva/Milestone 10/2/Practice1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include<bits/stdc++.h>
using namespace std;
int cube(int n){
int x;
x=n*n*n;
return x;
}
int main(){
int a;
cin>>a;
cout<<cube(a);
return 0;
}
Binary file added Cherish Sachdeva/Milestone 10/2/Practice1.exe
Binary file not shown.
24 changes: 24 additions & 0 deletions Cherish Sachdeva/Milestone 10/2/Practice2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include<bits/stdc++.h>
using namespace std;
int area(int r){
int A;
A=(22*r*r)/7;
return A;
}
int circumference(int r){
int C;
C=(2*22*r)/7;
return C;
}
int diameter(int r){
int d=r*2;
return d;
}
int main(){
int r;
cin>>r;
cout<<"Area of crcle is "<<area(r)<<endl;
cout<<"Circumference of circle is "<<circumference(r)<<endl;
cout<<"Diameter is "<<diameter(r)<<endl;
return 0;
}
Binary file added Cherish Sachdeva/Milestone 10/2/Practice2.exe
Binary file not shown.
13 changes: 13 additions & 0 deletions Cherish Sachdeva/Milestone 10/2/Practice3.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include<bits/stdc++.h>
using namespace std;
int max(int a,int b){
int c=a>b?a:b;
return c;
}
int main(){
int a,b;
cin>>a;
cin>>b;
cout<<"Max is "<<max(a,b);
return 0;
}
Binary file added Cherish Sachdeva/Milestone 10/2/Practice3.exe
Binary file not shown.
19 changes: 19 additions & 0 deletions Cherish Sachdeva/Milestone 10/2/Practice4.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include<bits/stdc++.h>
using namespace std;
bool type(int n){
if(n%2==0){
return true;
}else{
return false;
}
}
int main(){
int a;
cin>>a;
if(type(a)){
cout<<"Even";
}else{
cout<<"Odd";
}
return 0;
}
Binary file added Cherish Sachdeva/Milestone 10/2/Practice4.exe
Binary file not shown.
49 changes: 49 additions & 0 deletions Cherish Sachdeva/Milestone 10/2/Practice5.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#include<bits/stdc++.h>
using namespace std;
bool prime(int n){
for(int i=2;i<n;i++){
if(n%i==0){
return false;
}
}
return true;
}
bool perfect(int n){
int sum=0;
int a=n;
for(int i=1;i<n;i++){
if(n%i==0){
sum+=i;
}
}
if(sum==a){
return true;
}else{
return false;
}
}
bool armstrong(int n){
int a=n,sum=0,rem;
while(n!=0){
rem=n%10;
sum+=rem*rem*rem;
n/=10;
}
if(sum==a){
return true;
}else{
return false;
}
}
int main(){
int x;
cin>>x;
if(armstrong(x)){
cout<<x<<" is armstrong number"<<endl;
}else if(perfect(x)){
cout<<x<<" is perfect number"<<endl;
}else if(prime(x)){
cout<<x<<" is prime number"<<endl;
}
return 0;
}
Binary file added Cherish Sachdeva/Milestone 10/2/Practice5.exe
Binary file not shown.
Loading