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 C/C++ program that connects to a MySQL server and checks intrusion attempts every 5 minutes. If an intrusion attempt is detected beep the internal speaker to alert the administrator. A high number of aborted connects to MySQL at a point in time may be used as a basis of an intrusion.

1 Answers  


Why is this loop always executing once?

0 Answers  


What is the c value paradox and how is it explained?

0 Answers  


True or false: If you continuously increment a variable, it will become negative? 1) True 2) False 3) It depends on the variable type

7 Answers  


write a program to produce the following output; ABCDEFGFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD DCBA ABC CBA AB BA A A

17 Answers   ABC, College School Exams Tests,






Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant

0 Answers  


What is the use of putchar function?

0 Answers  


Can a void pointer point to a function?

0 Answers  


What are data types in c language?

0 Answers  


What is the difference between %d and %i?

0 Answers  


How can I split up a string into whitespace-separated fields?

0 Answers  


main() { FILE *fs; char c[10]; fs = fopen(“source.txt”, ”r”); /* source.txt exists and contains “Vector Institute” */ fseek(fs,0,SEEK_END); fseek(fs,-3L,SEEK_CUR); fgets(c,5,fs); puts(c); }

1 Answers   Vector,


Categories