What is the correct code to have following output in c using nested for loop?



What is the correct code to have following output in c using nested for loop?..

Answer / Rajeev Kumar Singh

To print a pyramid of stars, here's an example using two nested 'for' loops: `#include <stdio.h> int main() { int i, j; for (i = 1; i <= 5; ++i) { for (j = 1; j <= i; ++j) printf("*"); printf("n"); } return 0; }`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

how many key words availabel in c a) 28 b) 31 c) 32

1 Answers  


What are linker error?

1 Answers  


HOW TO HANDLE EXCEPTIONS IN C

8 Answers  


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1 Answers   Wilco,


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

1 Answers   Wilco,


Determine if a number is a power of 2 at O(1).

2 Answers  


Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

1 Answers  


what is the first address that gets stored in stack according to a C or C++ compiler???? or what will be the first address that gets stored when we write a C source code????????

2 Answers   Apple,


write a program to display reverse of a number using for loop?

14 Answers  


If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above

1 Answers  


write a program to find a given no. is divisible by 3 or not without using any arthimetic operators?

3 Answers   Broadcom, TCS,


Why can't we initialise member variable of a strucutre

1 Answers  


Categories