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

how can i get output like this?
1
2 3
4 5 6

Answer Posted / nayan soni

#include <stdio.h>
#include <conio.h>

void main()
{
int count = 1;
for(int i = 1;i <= 3;i++)
{
for(int j = 1;j <= i;j++)
{
printf("%d ", count);
count++;
}
printf("\n");
}

getch();
}

It works perfectly.. Tested by running the program..

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why isnt any of this standardized in c?

1074


Write a program to reverse a string.

1074


Is it better to bitshift a value than to multiply by 2?

1092


What 'lex' does?

1177


What are multidimensional arrays?

1119


Tell me the use of bit field in c language?

1064


Difference between linking and loading?

1096


How reliable are floating-point comparisons?

1094


Explain the difference between #include "..." And #include <...> In c?

1024


How can I read a binary data file properly?

1162


What is a list in c?

1030


Explain the difference between strcpy() and memcpy() function?

1000


What is clrscr ()?

1106


What is void main () in c?

1205


How to get string length of given string in c?

1067