Can anyone help me with this please? Need to print the below
values.. Thanks

1
1 2
1 2 3
1 2 3 4

Answers were Sorted based on User's Feedback



Can anyone help me with this please? Need to print the below values.. Thanks 1 1 2 1 2 3 1 2 ..

Answer / hari

#include<stdio.h>
main()
{
int i,j= 0;
for(j= 1;j<=5 ;j++)
{
for(i=1;i<=j;i++)
printf("%d ",i);
printf("\n");
}
}

Is This Answer Correct ?    5 Yes 1 No

Can anyone help me with this please? Need to print the below values.. Thanks 1 1 2 1 2 3 1 2 ..

Answer / mohit (firozabad, a.d.college)

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=4;i++)
{
for(j=1;j<=i;j++)
printf("%d",j);
}
printf("\n");
getch();
}

Is This Answer Correct ?    4 Yes 0 No

Can anyone help me with this please? Need to print the below values.. Thanks 1 1 2 1 2 3 1 2 ..

Answer / carol

#include<stdio.h>
main()
{
int i,j= 0;
for(j= 1;j<=5 ;j++)
{
for(i=1;i<=j;i++)
printf("%d ",i);
printf("\n");
}
}

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Interview Questions

#include<stdio.h> void main() { int a=10,b=20,c=30; printf("%d",scanf("%d%d%d",&a,&b,&c)); } what is the output for this?

4 Answers   IIIT,


What is C++

4 Answers  


What is conio h in c?

0 Answers  


How do you determine the length of a string value that was stored in a variable?

0 Answers  


Why can't I perform arithmetic on a void* pointer?

0 Answers  






What is the difference between macros and inline functions?

5 Answers   Global Edge, L&T,


what is the different between if-else and switch statment (other than syntax)

26 Answers   CTS, Oracle, Scorpos,


What are identifiers in c?

0 Answers  


What are the advantages of using linked list for tree construction?

0 Answers  


Distinguish between actual and formal arguments.

0 Answers  


difference between string and array?

6 Answers  


Explain what is meant by 'bit masking'?

0 Answers  


Categories