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's the difference between constant char *p and char * constant p?
What is a list in c?
Is struct oop?
What is the difference between procedural and functional programming?
swap 2 numbers without using third variable?
Write the test cases for checking a variable having value in range -10.0 to +10.0?
What is mean by data types in c?
Explain goto?
What are valid operations on pointers?
What does struct node * mean?
What do mean by network ?
Is it possible to initialize a variable at the time it was declared?
Explain the use of keyword 'register' with respect to variables.
code for find determinent of amatrix
Function calling procedures? and their differences? Why should one go for Call by Reference?