how can i get this by using for loop?
*
**
*
****
*
******
Answer Posted / vignesh1988i
#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)
{
for(int j=-2;j<=i;j+=2)
printf("*");
printf("*\n*");
}
getch();
}
thank u
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain the difference between null pointer and void pointer.
What is dangling pointer in c?
What is typedef struct in c?
What is the difference between text and binary i/o?
What is the purpose of type declarations?
application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
Does c have function or method?
Why is event driven programming or procedural programming, better within specific scenario?
application attempts to perform an operation?
Explain how does flowchart help in writing a program?
Why are all header files not declared in every c program?
Is fortran faster than c?
which is an algorithm for sorting in a growing Lexicographic order
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"