Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.

Answer Posted / prasanna

#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,j;
printf("enter the lines:");
scanf("%d",&n);
for(i=1;i<=n/2;i++)
{
printf("/n");
for(j=1;j<=2*i;j++)
printf("\n");
}
if(n%2!=0);
printf("\n");
getch();
}

Is This Answer Correct ?    10 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a far pointer in c?

1005


What is #include stdio h?

1075


Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

1035


What are the 5 types of inheritance in c ++?

984


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

1030


What is the size of structure in c?

1115


Write a code to remove duplicates in a string.

992


Explain how can I manipulate strings of multibyte characters?

1173


What does malloc () calloc () realloc () free () do?

1025


write a program to create a sparse matrix using dynamic memory allocation.

4857


Why c is faster than c++?

993


When should structures be passed by values or by references?

1010


What is hash table in c?

991


What are the benefits of c language?

1125


What is the difference between test design and test case design?

2048