diff --git a/CodeForWin/1.cpp b/CodeForWin/1.cpp new file mode 100644 index 00000000..edaf29e2 --- /dev/null +++ b/CodeForWin/1.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; + + + int cube( int a) + { + int ans = a*a*a; + return ans; + } + +int main() +{ + int a; + cin>>a; + + cout << "Cube of "< +using namespace std; + + + int diameter( int a) + { + int ans1 = a*2; + return ans1; + } + + float circumference( int a) + { + float ans2 = 2*a*3.14; + return ans2; + } + + float area( int a) + { + float ans3 = 3.14*a*a; + return ans3; + } + +int main() +{ + int a; + cin>>a; + + cout << "Diameter of circle with radius "<>a; + + even_odd(a); + + + return 0; +} \ No newline at end of file diff --git a/CodeForWin/5.cpp b/CodeForWin/5.cpp new file mode 100644 index 00000000..eed0ec0b --- /dev/null +++ b/CodeForWin/5.cpp @@ -0,0 +1,80 @@ +#include +#include +using namespace std; + + + void prime( int a) + { + bool check = 0; + + for( int i=2; i<=sqrt(a); i++) + { + if(a%i==0) + { + cout<0) + { + int last = a%10; + y= y+ (last*last*last); + a=a/10; + } + + if( y==original) + { + cout<>a; + + prime(a); + armstrong(a); + perfect(a); + + return 0; +} \ No newline at end of file diff --git a/CodeForWin/6.cpp b/CodeForWin/6.cpp new file mode 100644 index 00000000..b6607832 --- /dev/null +++ b/CodeForWin/6.cpp @@ -0,0 +1,42 @@ +#include +#include +using namespace std; + + + + int isprime( int a) + { + for( int i=2; i<=a/2; i++ ) + { + if( a%i==0) + { + return 0; + } + } + return 1; + + } + + + void prime( int a, int b) + { + while( a<=b) + { + if( isprime(a)) + { + cout<>a>>b; + + prime(a , b); + + return 0; +} \ No newline at end of file diff --git a/CodeForWin/7.cpp b/CodeForWin/7.cpp new file mode 100644 index 00000000..e8d1481c --- /dev/null +++ b/CodeForWin/7.cpp @@ -0,0 +1,53 @@ +#include +#include +using namespace std; + + + int isstrong( int a) + { + int fact = 1, original =a, sum=0; + + while( a>0) + { + int last = a%10; + + for( int i=1; i<=last; i++) + { + fact = fact*i; + } + + sum = sum + fact; + a = a/10; + } + + if( sum == original) + { + return 1; + } + + return 0; + } + + void strong( int a, int b) + { + while( a<= b) + { + if(isstrong(a)) + { + cout<>a>>b; + + strong(a,b); + + return 0; +} \ No newline at end of file diff --git a/KhushiPM/1.cpp b/KhushiPM/1.cpp new file mode 100644 index 00000000..edaf29e2 --- /dev/null +++ b/KhushiPM/1.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; + + + int cube( int a) + { + int ans = a*a*a; + return ans; + } + +int main() +{ + int a; + cin>>a; + + cout << "Cube of "< +using namespace std; + + + int diameter( int a) + { + int ans1 = a*2; + return ans1; + } + + float circumference( int a) + { + float ans2 = 2*a*3.14; + return ans2; + } + + float area( int a) + { + float ans3 = 3.14*a*a; + return ans3; + } + +int main() +{ + int a; + cin>>a; + + cout << "Diameter of circle with radius "<>a; + + even_odd(a); + + + return 0; +} \ No newline at end of file diff --git a/KhushiPM/5.cpp b/KhushiPM/5.cpp new file mode 100644 index 00000000..eed0ec0b --- /dev/null +++ b/KhushiPM/5.cpp @@ -0,0 +1,80 @@ +#include +#include +using namespace std; + + + void prime( int a) + { + bool check = 0; + + for( int i=2; i<=sqrt(a); i++) + { + if(a%i==0) + { + cout<0) + { + int last = a%10; + y= y+ (last*last*last); + a=a/10; + } + + if( y==original) + { + cout<>a; + + prime(a); + armstrong(a); + perfect(a); + + return 0; +} \ No newline at end of file diff --git a/KhushiPM/6.cpp b/KhushiPM/6.cpp new file mode 100644 index 00000000..b6607832 --- /dev/null +++ b/KhushiPM/6.cpp @@ -0,0 +1,42 @@ +#include +#include +using namespace std; + + + + int isprime( int a) + { + for( int i=2; i<=a/2; i++ ) + { + if( a%i==0) + { + return 0; + } + } + return 1; + + } + + + void prime( int a, int b) + { + while( a<=b) + { + if( isprime(a)) + { + cout<>a>>b; + + prime(a , b); + + return 0; +} \ No newline at end of file diff --git a/KhushiPM/7.cpp b/KhushiPM/7.cpp new file mode 100644 index 00000000..e8d1481c --- /dev/null +++ b/KhushiPM/7.cpp @@ -0,0 +1,53 @@ +#include +#include +using namespace std; + + + int isstrong( int a) + { + int fact = 1, original =a, sum=0; + + while( a>0) + { + int last = a%10; + + for( int i=1; i<=last; i++) + { + fact = fact*i; + } + + sum = sum + fact; + a = a/10; + } + + if( sum == original) + { + return 1; + } + + return 0; + } + + void strong( int a, int b) + { + while( a<= b) + { + if(isstrong(a)) + { + cout<>a>>b; + + strong(a,b); + + return 0; +} \ No newline at end of file diff --git a/KhushiPM/Khushi_Milestone6 b/KhushiPM/Khushi_Milestone6 new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/KhushiPM/Khushi_Milestone6 @@ -0,0 +1 @@ + diff --git a/Khushi_Milestone10 b/Khushi_Milestone10 new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/Khushi_Milestone10 @@ -0,0 +1 @@ +