C C++ Errors Question:
Download Questions PDF

Display this kind of output on screen.
1
0 1
1 0 1
3. Display this kind of output on screen.
1
1 0
1 0 1
4. Display this kind of output on screen.
1
1 0
1 0 1
5.Display this kind of output on screen.
1
2 3
4 5 6
7 8 9 10

Answer:

void main()
{
int i,j;
for(i=0;i<=2;i++)
{
for(j=2;j>i;j--)
printf(" ");
for(j=1;j<(i+1);j++)
{
printf("%d",mod(j-i));
}
printf("/n");
}
getch();
}

------------------------------\void main()
{
int i,j;
for(i=0;i<=2;i++)
{
// for(j=2;j>i;j--)
// printf(" ");
for(j=1;j<(i+1);j++)
{
printf("%d",mod(i-j));
}
printf("/n");
}
getch();
}
--------------------------------
void main()
{
int i,j;
for(i=0;i<=2;i++)
{
//for(j=2;j>i;j--)
// printf(" ");
for(j=1;j<(i+1);j++)
{
printf("%d",mod(j-i));
}
printf("/n");
}
getch();
}
-------------------------
void main()
{
int i,j,k=1;
for(i=0;i<=3;i++)
{
for(j=3;j>i;j--)
printf(" ");
for(j=1;j<(i+1);j++)
{
k=k+1;
printf("%d",k);
}
printf("/n");
}
getch();
}

Download C C++ Errors Interview Questions And Answers PDF

Previous QuestionNext Question
How to reverse a linked list without using array & -1?Explain what is macro in c?
Difference between single linked list & double linked list what is fifo & lifo?
what is stack & queue?