how can i get this by using for loop?
*
**
*
****
*
******
Answer Posted / vignesh1988i
sorry folks, a small mistake in above program , the below is the correct one's...........
#include<stdio.h>
#include<conio.h>
void main()
{
int m;
clrscr();
printf("enter the lines :");
scanf("%d",&m);
for(int i=1;i<=m;i+=2)
{
printf("*");
for(int j=-2;j<=i;j+=2)
printf("*");
printf("*\n");
}
getch();
}
thank u
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
writ a program to compare using strcmp VIVA and viva with its output.
What are preprocessor directives in c?
Why do we use namespace feature?
Is array a primitive data type in c?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
Differentiate between a for loop and a while loop? What are it uses?
What are enumerated types?
What is the difference between pure virtual function and virtual function?
What is the difference between typedef and #define?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
How can I recover the file name given an open stream?
What are the preprocessor categories?
What is difference between arrays and pointers?
Why void main is used in c?