Write a program in c to print
*
* *
* *
*******



Write a program in c to print * * * * * *******..

Answer / kapil

#include<stdio.h>
void main()
{
int i=0,j=1;
while(i<3)
{
while(j<=7)
{
if(j-i==4||j+i==4)
printf("*");
else
printf(" ");
j++;
}
printf("\n");
i++;
j=1;
}
while(j<=7)
{
printf("*");
j++;
}
}

Is This Answer Correct ?    5 Yes 2 No

Post New Answer

More C Interview Questions

What is pointers in c with example?

0 Answers  


Q.11 Generate the following pattern using code in any language(c/c++/java) for n no. of rows 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1

2 Answers  


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions

0 Answers  


wats the diference btwen constant pointer and pointer to a constant.pls give examples.

9 Answers  


What does %c do in c?

0 Answers  






How to reverse alternate words in a given line of string For Eg: my name is narasimha output : my eman is ahmisaran

0 Answers  


What is memory leak in c?

0 Answers  


can we declare a function inside the structure? ex: struct book { int pages; float price; int library(int,float); }b; is the above declaration correct? as it has function declaration?

2 Answers  


what is Structural oriented language? give some example of this language.....?

1 Answers  


how to add our own function in c library please give details.?

1 Answers   TCS,


What is the use of #include in c?

0 Answers  


Where we use clrscr in c?

0 Answers  


Categories