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

#include<stdio.h>
#include<conio.h>
main()
{
int i,n,j;
int m=1;
clrscr();
printf("enter number");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
printf("%d",m++);
}
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

how do you programme Carrier Sense Multiple Access

1970


what is the basis for selection of arrays or pointers as data structure in a program

4312


What are the types of pointers in c?

1029


What is nested structure?

1054


ATM machine and railway reservation class/object diagram

5253


What are dangling pointers in c?

1247


Explain Function Pointer?

1186


Is it valid to address one element beyond the end of an array?

1176


explain what are actual arguments?

1097


What is difference between union and structure in c?

1173


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2076


What’s the special use of UNIONS?

1152


a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none

1285


Why do we need arrays in c?

1161


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

1043