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


Please Help Members By Posting Answers For Below Questions

What's the difference between constant char *p and char * constant p?

755


What is a list in c?

707


Is struct oop?

663


What is the difference between procedural and functional programming?

598


swap 2 numbers without using third variable?

751






Write the test cases for checking a variable having value in range -10.0 to +10.0?

1934


What is mean by data types in c?

649


Explain goto?

804


What are valid operations on pointers?

800


What does struct node * mean?

692


What do mean by network ?

774


Is it possible to initialize a variable at the time it was declared?

860


Explain the use of keyword 'register' with respect to variables.

700


code for find determinent of amatrix

1621


Function calling procedures? and their differences? Why should one go for Call by Reference?

731