What is source code of this tringle A A N I A N I R B A N I R B A N A N I R B A N P A A N I R B A N P A U L 2) A N I R B A N P A 3) 1 2 3 4 5 6 7 8 9

Questions by Bunti12

Showing Answers 1 - 4 of 4 Answers

kaushalgoa

  • Dec 31st, 2007
 

int main()
{
    char str[20] = "ANIRBANPAUL";
    int x= 0, y = 0, z = 0;

    z = strlen(str);
    
    for(x = 0; x < z; x+=2)
    {
        for(y = 0; y <= x; y++)
        {
            printf("%c",str[y]);
        }
        printf("n");
    }

}

  Was this answer useful?  Yes

Program-2 ANIRBANPA
Ans-2
Char A[12]=”ANIRBANPAUL”;
Static int k=0;
For (int i=0;I<=strlen(A); I+=2)
{
For(j=0;j<=I;j++)
{
Printf(%c,A[k]);
K++;
}
//inner for loop
printf(“n”);
}
//outer for loop /
Program-3123456789
Ans-3
static int k=1;
for( int I =1; I<=5; I+=2 )
{
for( int j=1; j<=I;j++ )
{
printf(“%d”,k ); k++; }
//inner for loop
printf(“n”);
}//outer for loop

  Was this answer useful?  Yes

jeyaraj.ck

  • Mar 18th, 2008
 

3)
1
234
56789


#define MAX 9

int main()

{

int int_array[MAX] = {1,2,3,4,5,6,7,8,9}; int i,j,k,odd,h=0;
for(k=0,i=0,odd=1; i<3; i++,k+=odd)

{

if(k!=0)

odd+=2;

for(j=k; (j<k+odd)&&(h<MAX);j++)

{

printf("%d ",int_array[j]);

h++;

}

printf("backslashn");

}

getch();

}

//backslash is

  Was this answer useful?  Yes

jeyaraj.ck

  • Mar 18th, 2008
 

#define MAX 12

int main()

{

char name[MAX] = "Bangalor";int i,j,k,odd,h=0;
for(k=0,i=0,odd=1; i<4; i++,k+=odd)

{

if(k!=0)

odd+=2;

for(j=k; (j<k+odd)&&(h<MAX);j++)

{

printf("%c ",name[j]);

h++;

}

printf("Backslashn");

}

getch();

}




// Backslash is

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions