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


Please Help Members By Posting Answers For Below Questions

a value that does not change during program execution a) variabe b) argument c) parameter d) none

690


Is fortran faster than c?

572


What do you know about the use of bit field?

606


What should malloc() do?

639


What are derived data types in c?

606






What is adt in c programming?

607


design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.

1492


Write a program for finding factorial of a number.

629


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

1425


What is the difference between call by value and call by reference in c?

614


What is spaghetti programming?

666


What is the use of getch ()?

629


What are the data types present in c?

623


What is the use of f in c?

553


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

647