Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.
Answer Posted / srinivas 9491582281
#include<stdio.h>
#include<conio.h>
main()
{
int i,j;
clrscr();
for(i=1;i<=10;i++)
{
if(i%2!=0)
printf("*\n");
else
{
for(j=1;j<=i;j++)
printf("*");
printf("\n");
}
}
getch();
}
| Is This Answer Correct ? | 15 Yes | 7 No |
Post New Answer View All Answers
What is the difference between exit() and _exit() function?
application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above
What is the difference between memcpy and memmove?
What functions are in conio h?
How do you determine the length of a string value that was stored in a variable?
What is a const pointer?
FILE PROGRAMMING
What is difference between constant pointer and constant variable?
Explain what does it mean when a pointer is used in an if statement?
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
What do you know about the use of bit field?
What is array in c with example?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
What kind of structure is a house?