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 / reshma m.
int i,j,m;
m=2;
for(i=0;i<5;i++)
{putch('*');
putch('\n');
for(j=0;j<m;j++)
{putch('*');
m+=2;
}
putch('\n');
}
Is This Answer Correct ? | 4 Yes | 5 No |
Post New Answer View All Answers
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
How can you find the exact size of a data type in c?
What does return 1 means in c?
Can a variable be both static and volatile in c?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
Are enumerations really portable?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What is meant by type casting?
Is javascript based on c?
Mention four important string handling functions in c languages .
What is the meaning of typedef struct in c?
What are valid operations on pointers?
What is difference between && and & in c?
What are the general description for loop statement and available loop types in c?
What is I ++ in c programming?