write a program in c to print ****
* *
* *
****



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

Answer / rajkumar

#include<stdio.h>
#include<conio.h>
void main()
{
int i;
for(i=0;i<=3;i++)
{
printf("*");
}
for(i=4;i<5;i++)
{
printf(" ");
}
for(i=5;i<6;i++)
{
printf("*");
}
for(i=6;i<7;i++)
{
printf(" ");
}
for(i=7;i<8;i++)
{
printf("*");
}
for(i=8;i<9;i++)
{
printf(" ");
}
for(i=9;i<10;i++)
{
printf("*");
}
for(i=10;i<11;i++)
{
printf(" ");
}
for(i=11;i<12;i++)
{
printf("*");
}
for(i=12;i<13;i++)
{
printf(" ");
}
for(i=12;i<=15;i++)
{
printf("*");
}
getch();
}

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More C Interview Questions

What is the purpose of sprintf?

0 Answers  


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

0 Answers  


WRITE A C PROGRAM FOR PRINT "RHOMBUS" STRUCTURE . Example: Enter the numbers :3 * * * * * * * *

3 Answers   Infosys, TCS,


what is data structure

5 Answers   Maveric, TCS,


Explain what are linked list?

0 Answers  


plz answer....A program that takes 3 variables e.g a,b,c in as seperate parameters and rotates the values stored so that value goes a to b, b to c and c to a .

3 Answers  


In a header file whether functions are declared or defined?

0 Answers   TISL,


Do you know what are the properties of union in c?

0 Answers  


How can I send mail from within a c program?

0 Answers  


Tell us bitwise shift operators?

0 Answers  


i=20,k=0; for(j=1;j<i;j=1+4*(i/j)) { k+=j<10?4:3; } printf("%d", k);

8 Answers   HCL,


program for reversing a selected line word by word when multiple lines are given without using strrev

0 Answers   IBM,


Categories