diff --git a/e1.c b/e1.c index e69de29..2a15d00 100644 --- a/e1.c +++ b/e1.c @@ -0,0 +1,11 @@ +#include + +void main() +{ + int a; + scanf("%d",&a); + if(a%2==0) + cout<<"Even"; + else + cout<<"odd"; +} diff --git a/h1.c b/h1.c index e69de29..cbd586b 100644 --- a/h1.c +++ b/h1.c @@ -0,0 +1,64 @@ +//Code to print the following series +// 555555555 +// 544444445 +// 543333345 +// 543222345 +// 543212345 +// 543222345 +// 543333345 +// 544444445 +// 555555555 + + +#include + +int main() +{ + int a,s; + + printf("Enter the number : "); + scanf("%d",&a); + + s=a; + for(int i=0;i<((2*a)+1)/2;++i) + { + if(i==0) + for(int j=1;j<(2*a)-1;++j) + printf("%d ",a); + else + { + printf("%d ",a); + for(int j=0;j0;--j) + printf("%d ",a-j); + + } + printf("%d\n",a); + s--; + } + s++; + for(int i=(2*a-3)/2;i>=0;--i) + { s++; + if(s==a) + for(int j=0;j<(2*a)-1;++j) + printf("%d ",a); + else + { + printf("%d ",a); + + for(int j=0;j0;--j) + printf("%d ",a-j); + printf("%d",a); + } + printf("\n"); + } + +return 0; +}