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 / abdi

#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 ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a constant and types of constants in c?

1140


How can I manipulate strings of multibyte characters?

1115


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

2178


write a c program to calculate sum of digits till it reduces to a single digit using recursion

3314


What is sizeof array in c?

1062


what are enumerations in C

1163


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

1176


What is %d used for?

1042


how to write a c program to print list of fruits in alpabetical order?

2306


What is a lookup table in c?

1124


swap 2 numbers without using third variable?

1138


The __________ attribute is used to announce variables based on definitions of columns in a table?

1214


Explain the difference between call by value and call by reference in c language?

1115


Explain what are bus errors, memory faults, and core dumps?

1283


Is c easier than java?

1083