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
How can I manipulate strings of multibyte characters?
can we change the default calling convention in c if yes than how.........?
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above
What is the modulus operator?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
I have seen function declarations that look like this
What are the 5 data types?
Which is best linux os?
What are types of structure?
Explain what is the difference between the expression '++a' and 'a++'?
Which one would you prefer - a macro or a function?
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....
Calculate 1*2*3*____*n using recursive function??
Why doesnt this code work?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures