Write a program to construct a pyramid of numbers .

Solution :- #include<stdio.h>#include<string.h>int main(){ int n,i,j,k; while(scanf(“%d”,&n)==1) {     for(i=1;i<=n;i++){         for(j=1;j<=n-i;j++)         printf(” “);         for(k=1;k<=i;k++)         printf(“1”);         printf(“n”);     }}return 0;}/*  Input :- 5 Output :-         1      1 1    1 1 1  1 1 1 11 1 1 1 1 */ At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming...

Uva 11597 – Spanning Subtree

Problem:- http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2644 Solution :- #include<stdio.h> int main() {     int a,i=1;     while(scanf(“%d”,&a)==1 && a>1)     {         printf(“Case %d: %dn”,i,a/2);         i++;     }     return 0; } At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming...

LightOJ 1182 – Parity

Problem Link Solution :- Parity C++ #include<stdio.h> int main() { int a,n,c[10000],i,sum,m,z; while((scanf("%d",&m))==1) { for(z=1;z<=m;z++) { scanf("%d",&n); sum=0; for(i=0;n>0;i++) { c[i]=n%2; n=n/2; sum=sum+c[i]; } if(sum%2==0) printf("Case %d: evenn",z); else printf("Case %d: oddn",z); } } return 0; } 123456789101112131415161718192021222324 #include<stdio.h>int main(){    int a,n,c[10000],i,sum,m,z;    while((scanf("%d",&m))==1)    {        for(z=1;z<=m;z++)        {            scanf("%d",&n);            sum=0;            for(i=0;n>0;i++)            {                 c[i]=n%2;                 n=n/2;                 sum=sum+c[i];            }            if(sum%2==0)                printf("Case %d: evenn",z);            else                printf("Case %d: oddn",z);        }    }    return 0;}...

LightOJ 1107 – How Cow

Problem:-http://www.lightoj.com/volume_showproblem.php?problem=1107 Solution :- #include<stdio.h> int main() {     int t,k,x1,y1,x2,y2,x,y,n,i;     scanf(“%d”,&t);     for(k=1;k<=t;k++)     {         scanf(“%d%d%d%d%d”,&x1,&y1,&x2,&y2,&n);         printf(“Case %d:n“,k);         for(i=0;i<n;i++)         {             scanf(“%d%d”,&x,&y);             if(x>x1 && x<x2 && y>y1 && y<y2)             printf(“Yesn“);             else printf(“Non“);         }     }     return 0; } At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming...

LightOJ 1227 – Boiled Eggs

Problem:-http://www.lightoj.com/volume_showproblem.php?problem=1227 Solution :- #include<stdio.h> int main() {     int n,i,k,a,b,c,d[1000],t=1;     scanf(“%d”,&n);     while(t<=n)     {         int s=0;         scanf(“%d %d %d”,&a,&b,&c);         i=1;         while(i<=a)         {             scanf(“%d”,&d[i]);             i++;         }         k=0;         for(i=1;i<=a && i<=b;i++)         {             s+=d[i];             if(s>c)             break;             k++;         }         printf(“Case %d: %dn“,t,k);         t++;     }     return 0; } At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming...