Print the foll in C...eg when n=5 the o/p must b
+ +
+ + + +
+ + + + +
+ + + +
+ +



Print the foll in C...eg when n=5 the o/p must b + + + + + + + + + + + + + + + + ..

Answer / 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

More C Interview Questions

What is the diffences between Windows XP and Windows Visa

1 Answers   Aricent, FHF,


Hi Every one......... Please Any body give me the answer for my question. Is it possible to print the word "PRINT F", without using printf() statement in C-Language.

4 Answers  


#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a; Printf(“%d\n”, ++*I); Printf(“%d\n”, *++I); Printf(“%d\n”, (*I)--); Printf(“%d\n”, *I); } what is the o/p a. 101,200,200,199 b. 200,201,201,100 c. 101,200,199,199 d. 200,300,200,100

1 Answers  


Why do we use static in c?

0 Answers  


Write a program that his output 1 12 123

0 Answers  






main() { int x=5,y=10,z=0; x=x++ + y++; y=y++ + ++x; z=x++ + ++y; printf("%d%d%d\n",x,y,z); }

1 Answers   CodeChef,


what is the need for main function in c?

5 Answers  


What are enums in c?

0 Answers  


What is identifier in c?

0 Answers  


How can I invoke another program or command and trap its output?

0 Answers  


is compiler do read the data line by line or not. ??

6 Answers   LG Soft, Satyam, Tech Mahindra,


Can we replace the struct function in tree syntax with a union?

0 Answers   Huawei,


Categories