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

write a programming in c to find the sum of all elements in an array through function.

0 Answers  


whenever a question is posted in a particular category in allinterview.com, Is there any facility to receive an indication mail. For eg: I need to receive an indication email, whenever a question is posted under the category “C Langauage”.

1 Answers  


Read two numbers from keyboard and find maximum of them?

1 Answers  


How many ways are there to swap two numbers without using temporary variable? Give the each logic.

9 Answers  


WHY DO WE USE A TERMINATOR IN C LANGUAGE?

2 Answers  






Explain #pragma statements.

0 Answers  


List some of the static data structures in C?

0 Answers  


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

0 Answers  


What is an volatile variable?

15 Answers   HP,


#include<stdio.h> int f(int,int); int main() { printf("%d",f(20,1)); return 0; } int f(int n,int k) { if(n==0) return 0; else if(n%2)return f(n/2,2*k)+k; else return f(n/2,2*k)-k; } how this program is working and generating output as 9....?

1 Answers  


What is meant by operator precedence?

0 Answers  


What is the difference between typeof(foo) and myFoo.GetType()?

2 Answers   Synergy,


Categories