what is the code for getting the output as
*
**
***
Answers were Sorted based on User's Feedback
Answer / gg
#include<stdio.h>
main()
{
int n,i=0,j=0;
printf("Enter an intger : ");//upto n nof *'s
scanf("%d",&n);
while(j<n)
{
for(i=0;i<=j;printf("*"),i++);
printf("\n",j++);
}
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sourisengupta
void main()
{
int i,j;
for(i=0;i<3;i++){
for(j=0;j<i;j++){
printf("*");
printf("\n");
}
}
}
| Is This Answer Correct ? | 1 Yes | 4 No |
Answer / pooja sonawane
void main()
{
int i,j;
for(i=0;i<3;i++)
printf("\n");
for(j=0;j<i;j++)
printf("*");
}
| Is This Answer Correct ? | 2 Yes | 6 No |
Why doesnt long int work?
int array[]={1,2,3,4,5,6,7,8}; #define SIZE (sizeof(array)/sizeof(int)) main() { if(-1<=SIZE) printf("1"); else printf("2"); }
print a "hello" word without using printf n puts in c language
c language interview questions & answer
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.
Please write the area of a RIGHT ANGLED TRIANGLE.
main difference between c and c++ language
What is the use of the #include directive?
What are the __date__ and __time__ preprocessor commands?
What is the difference b/w Structure & Array?
Should a function contain a return statement if it does not return a value?
difference between c and c++