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 / gana
{
int a,b=2,i;
char *s="\0";
for(i=0;i<5;i++)
{
for(a=0;a<5-i;a++)
putch(' ');
for(a=0;a<b;a++)
putch('*');
b+=2;
puts(s);
}
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Why shouldn’t I start variable names with underscores?
I need testPalindrome and removeSpace
#include
What does c mean before a date?
Which programming language is best for getting job 2020?
What are the types of c language?
List some of the static data structures in C?
What are the 5 types of organizational structures?
How do you declare a variable that will hold string values?
What is logical error?
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
What is difference between %d and %i in c?
Explain 'bit masking'?
How reliable are floating-point comparisons?
Explain how does flowchart help in writing a program?
What are qualifiers in c?