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


Please Help Members By Posting Answers For Below Questions

What is a program?

659


What are different storage class specifiers in c?

611


What are the disadvantages of external storage class?

584


Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

651


What is function prototype in c with example?

570






What is wrong in this statement?

601


In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]

1954


How can you invoke another program from within a C program?

609


What header files do I need in order to define the standard library functions I use?

535


What are identifiers c?

560


in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

591


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

632


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

2653


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

2980


What are enums in c?

655