Interviewer And Interviewee Guide

C C++ Errors Interview Question:

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

Submitted by: Administrator
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();
}
Submitted by: Administrator

Read Online C C++ Errors Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.