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...

code snippet for creating a pyramids triangle
ex

1
2 2
3 3 3

Answer Posted / rajesh kamar s

void main()

{
int n,i,j;
printf("enter the num of rows\t:");
scanf("%d",&n);

for(i=1;i<=n;i++)
{
for(int k=0;k<n-i;k++)
printf(" ");
for(j=1;j<=i;j++)
printf("%d ",i);
printf("\n");
}
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1730


Explain can the sizeof operator be used to tell the size of an array passed to a function?

1078


What is a pointer in c?

1585


Write a program to reverse a string.

1086


List some basic data types in c?

1033


What is meant by keywords in c?

1074


Explain how do you determine the length of a string value that was stored in a variable?

1158


What is the difference between printf and scanf )?

1105


What is adt in c programming?

1172


What is derived datatype in c?

1100


Can you write a programmer for FACTORIAL using recursion?

1049


Why main is not a keyword in c?

1260


Tell me what is the purpose of 'register' keyword in c language?

1012


Where register variables are stored in c?

970


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1288