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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

650


program to convert a integer to string in c language'

1970


What is else if ladder?

600


Why cant I open a file by its explicit path?

586


What is a spanning Tree?

936






Is c call by value?

591


What are external variables in c?

535


Can main () be called recursively?

619


How can you invoke another program from within a C program?

609


Where does the name "C" come from, anyway?

631


what is the basis for selection of arrays or pointers as data structure in a program

3780


Give basis knowledge of web designing ...

1564


What is c language and why we use it?

606


List the difference between a While & Do While loops?

625


How many main () function we can have in a project?

602