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 ?    1 Yes 4 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

What is the condition that is applied with ?: Operator?

0 Answers  


What is "Hungarian Notation"?

0 Answers   Celstream,


Write down the program to sort the array.

4 Answers   Impiger,


Explain the priority queues?

0 Answers  


what is the difference between procedure oriented and object oriented progaming language

1 Answers  






how can write all 1to 100 prime numbers using for loop,if and break ?

2 Answers   TCS,


What are identifiers c?

0 Answers  


In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.

0 Answers  


Which programming language is best for getting job 2020?

0 Answers  


12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV

4 Answers   Accenture,


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

0 Answers  


char ch="{'H','I',0};printf("%s",ch);what is output

9 Answers   Accenture,


Categories