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

The difference between printf and fprintf is ?

1298


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

1127


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

2350


How do we make a global variable accessible across files? Explain the extern keyword?

1887


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

1098


Is swift based on c?

1113


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1651


Why do we use int main instead of void main in c?

1155


What is the scope of an external variable in c?

1052


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1947


Which driver is a pure java driver

1632


What do you mean by c what are the main characteristics of c language?

1039


why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above

1096


What does the format %10.2 mean when included in a printf statement?

1662


What is a constant and types of constants in c?

1140