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
The file stdio.h, what does it contain?
Is there any possibility to create customized header file with c programming language?
What is pointers in c with example?
Does sprintf put null character?
can anyone suggest some site name..where i can get some good data structure puzzles???
What is d scanf?
Is int a keyword in c?
What is structure packing in c?
Why is main function so important?
What do you understand by friend-functions? How are they used?
How can I swap two values without using a temporary?
Why do we use int main?
What are identifiers and keywords in c?
What is the use of f in c?
What is the use of parallelize in spark?