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
In which language linux is written?
Which programming language is best for getting job 2020?
The difference between printf and fprintf is ?
What is a keyword?
What are the basic data types associated with c?
Here is a neat trick for checking whether two strings are equal
What are actual arguments?
Why we use break in c?
What is a union?
Combinations of fibanocci prime series
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
How do you use a 'Local Block'?
What is a pointer and how it is initialized?
What is the difference between variable declaration and variable definition in c?
What are the main characteristics of c language describe the structure of ac program?