Write a program in c to print
*
* *
* *
*******

Answer Posted / kapil

#include<stdio.h>
void main()
{
int i=0,j=1;
while(i<3)
{
while(j<=7)
{
if(j-i==4||j+i==4)
printf("*");
else
printf(" ");
j++;
}
printf("\n");
i++;
j=1;
}
while(j<=7)
{
printf("*");
j++;
}
}

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many header files are in c?

553


Why is c called c not d or e?

615


Describe newline escape sequence with a sample program?

657


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

2655


How can I change their mode to binary?

698






Is null a keyword in c?

737


Ow can I insert or delete a line (or record) in the middle of a file?

576


What are the characteristics of arrays in c?

616


Explain the difference between #include "..." And #include <...> In c?

633


Why do we need arrays in c?

583


Explain how many levels deep can include files be nested?

628


What are the functions to open and close file in c language?

729


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

645


What is the best style for code layout in c?

632


What are the modifiers available in c programming language?

740