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

write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

0 Answers  


Write a C program to multiply tho numbers without using arithmetic operator (+, -, *, /).

1 Answers  


Differentiate between a structure and a union.

0 Answers   Zensar,


How can we see the Expanded source code and compiled code for our source program in C?

1 Answers  


nic scientist exam

1 Answers   NIC,






main() { int x=20,y=35; x = y++ + x++; y = ++y + ++x; printf("%d %d\n",x,y); } what is the output?

10 Answers   Ramco,


main() { intx=2,y=6,z=6; x=y=z; printf(%d",x) }

5 Answers   Amazon, HCL, Thought Works,


what is the difference between call by value and call by reference?

5 Answers   Genpact, Global Logic, Infosys,


what is the purpose of the code, and is there any problem with the code? int f( int n, int l, int r ) { return (n << l) >> r; }

2 Answers   Google,


What is the use of pointers in C?

0 Answers   Impetus, Motorola, Tavant Technologies, Virtusa,


How can I read a directory in a c program?

1 Answers   CSC,


1.What is a Data Structure? Explain its need? 2.What is a Directed Graph? Write an algorithm to find whether a Directed Graph is connected or not? 3.Explain the process of converting a Tree to a Binary Tree.

4 Answers   Ignou, TCS,


Categories