what is the code for getting the output as
*
**
***

Answer Posted / gg

#include<stdio.h>
main()
{
int n,i=0,j=0;
printf("Enter an intger : ");//upto n nof *'s
scanf("%d",&n);
while(j<n)
{
for(i=0;i<=j;printf("*"),i++);
printf("\n",j++);
}
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a program flowchart and explain how does it help in writing a program?

634


One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.

2131


What are the different properties of variable number of arguments?

634


Explain how do you override a defined macro?

557


Explain how do you determine a file’s attributes?

572






What does the c preprocessor do?

596


What is nested structure with example?

600


How to create struct variables?

568


What is the mean of function?

628


What is #define used for in c?

590


What is the purpose of void in c?

595


Which function in C can be used to append a string to another string?

619


How can I avoid the abort, retry, fail messages?

628


program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)

1597


Why main is used in c?

560