how can i get this by using for loop?
*
**
*
****
*
******
Answers were Sorted based on User's Feedback
Answer / suman_kotte
int i,j;
for(i=1;i<=3;i++)
{
print("*");
print("\n");
for(j=1;j<=i*2;j++)
print("*");
print("\n");
}
| Is This Answer Correct ? | 14 Yes | 1 No |
#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 |
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 |
simple c program for 12345 convert 54321 with out using string
Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….
CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION.
Unsigned char c; for ( c=0;c!=256;c++2) printf("%d",c); No. of times the loop is executed ?
can we declare a function in side the structure?
C passes By value or By reference?
5 Answers Geometric Software, Infosys,
How can you print HELLO WORLD without using "semicolon"?
There seem to be a few missing operators ..
Why do we use stdio h and conio h?
What are the functions to open and close the file in c language?
What is meant by inheritance?
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none