WRITE A PROGRAM TO PRINT THE FOLLOWING OUTPUTS USING FOR
LOOPS.
A) * B) *****
*** * *
***** * *
*****
Answer Posted / vutukuru
#include<stdio.h>
main()
{
int i,j,n=5;
clrscr();
for(i=0;i<n-4;i++)
{
printf("*");
}
printf("\n");
for(i=0;i<n-2;i++)
{
printf("*");
}
printf("\n");
for(i=0;i<n;i++)
{
printf("*");
}
getch();
}
| Is This Answer Correct ? | 18 Yes | 12 No |
Post New Answer View All Answers
Are local variables initialized to zero by default in c?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Explain how do you convert strings to numbers in c?
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
Why can arithmetic operations not be performed on void pointers?
What does malloc () calloc () realloc () free () do?
What is bss in c?
What do you know about the use of bit field?
Are enumerations really portable?
Explain how can you determine the size of an allocated portion of memory?
Give me the code of in-order recursive and non-recursive.
what is a function method?give example?
What should malloc() do?
Is anything faster than c?
Explain how do you search data in a data file using random access method?