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
What is pointer to pointer in c?
What are data structures in c and how to use them?
How can type-insensitive macros be created?
Why do we need volatile in c?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
how to write a c program to print list of fruits in alpabetical order?
What are derived data types in c?
What is unary operator?
Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol
What is static memory allocation? Explain
Why is it important to memset a variable, immediately after allocating memory to it ?
When should you not use a type cast?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
What is n in c?
Explain what is wrong with this program statement?