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




Answers were Sorted based on User's Feedback



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

Answer / babitha

# include <Stdio.h>
# include <conio.h>
# include <string.h>

void main()
{
int j,i,n;

scanf("%d",&n);

for (i=0;i<=n;i++)
{
for(j=0;j<i;j++)
printf("*");
printf("\n");
}

getch();

}

Is This Answer Correct ?    6 Yes 1 No

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

Answer / 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

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

Answer / anvesh

main()
{
printf("*\n**\n***);
}
OR
main()
{
int n,i;
while(n<3)
{
i=0;
while(i<=n)
{printf("*");i++;}
printf("\n); n++;
}

Is This Answer Correct ?    4 Yes 3 No




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

Answer / sourisengupta

void main()
{
int i,j;
for(i=0;i<3;i++){
for(j=0;j<i;j++){
printf("*");
printf("\n");
}
}
}

Is This Answer Correct ?    0 Yes 3 No

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

Answer / pooja sonawane

void main()
{
int i,j;
for(i=0;i<3;i++)
printf("\n");
for(j=0;j<i;j++)
printf("*");
}

Is This Answer Correct ?    2 Yes 6 No

Post New Answer



More C Interview Questions

a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.

0 Answers  


wat is the output #define VOLEDEMORT _who_must_not_be_named int main() { printf("VOLEDEMORT"); }

2 Answers  


Hai what is the different types of versions and their differences

0 Answers  


How to write a program to receive an integer & find its octal equivalent by using for loop?

1 Answers   Google,


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

0 Answers  






write a program to find the given number is prime or not

2 Answers   Accenture, Vasutech,


where does malloc() function get the memory?

1 Answers  


which operator having lowest precedence?? a.)+ b.)++ c.)= d.)%

4 Answers  


why ordinary variable store the later value not the initial

1 Answers  


What is Heap?

3 Answers  


though sbi was nationalized why its not comes under nationalized banks and its comes under publicsector banks

3 Answers   State Bank Of India SBI,


class foo { public: static int func(const char*& p) const; }; This is illegal, why?

8 Answers   Google,






Categories