Print the foll in C...eg when n=5 the o/p must b
+ +
+ + + +
+ + + + +
+ + + +
+ +
Answer Posted / ataraxic
char *m[] = { "+ +", "++ ++", "+++++" };
for (i=1; i <= 5; i++)
printf("%s\n", m[5%i]);
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
What are the advantages and disadvantages of a heap?
What is a struct c#?
What are structures and unions? State differencves between them.
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
What is #error and use of it?
Explain the difference between malloc() and calloc() in c?
Explain what will the preprocessor do for a program?
What is difference between %d and %i in c?
Tell me with an example the self-referential structure?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
Explain the difference between malloc() and calloc() function?
What are the various types of control structures in programming?
How can I swap two values without using a temporary?
What are enumerated types?
Is c++ based on c?