Write a program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
Don't use printf statements;use two nested loops instead.
you will have to use braces around the body of the outer
loop if it contains multiple statements.
Answer Posted / rakesh
#include<stdio.h>
int main()
{
int i,j;
for(i=1;i<=10;i++){
if(i%2!=0)
{
putchar('*');
putchar('\n');
}
else{
for(j=0;j<i;j++)
putchar('*');
putchar('\n');
}
}
return 0;
}
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Can a variable be both constant and volatile?
What is a pragma?
How many main () function we can have in a project?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
where are auto variables stored? What are the characteristics of an auto variable?
show how link list can be used to repersent the following polynomial i) 5x+2
How to write a code for reverse of string without using string functions?
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
Explain the meaning of keyword 'extern' in a function declaration.
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
Explain how can I open a file so that other programs can update it at the same time?
What are variables c?
what do you mean by enumeration constant?
Explain what does it mean when a pointer is used in an if statement?