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 produce the following output:
1
2 3
4 5 6
7 8 9 10

Answer Posted / ashok kumar

void main()
{
int n,i,j,k=1;
clrscr();
printf("\n Enter a number : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=i;j<n;j++)
printf(" ");
for(j=1;j<=i;j++)
printf(" %d ",k++);
printf("\n");
}
getch();
}

Is This Answer Correct ?    31 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the advantage of an array over individual variables?

1187


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1169


What is malloc and calloc?

1004


can anyone please tell about the nested interrupts?

2064


What are actual arguments?

1045


Where static variables are stored in memory in c?

948


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

1070


What are the types of operators in c?

1002


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

1015


When should we use pointers in a c program?

1081


What is the purpose of void pointer?

986


write an interactive C program that will encode or decode a line of text.To encode a line of text,proceed as follows. 1.convert each character,including blank spaces,to its ASCII equivalent. 2.Generate a positive random integer.add this integer to the ASCII equivalent of each character.The same random integer will be used for the entire line of text. 3.Suppose that N1 represents the lowest permissible value in the ASCII code,and N2 represents the highest permissible value.If the number obtained in step 2 above(i.e.,the original ASCII equivalent plus the random integer)exceeds N2,then subtract the largest possible multiple of N2 from this number,and add the remainder to N1.Hence the encoded number will always fall between N1 and N2,and will therefore always represent some ASCII character. 4.Dislay the characters that correspond to the encoded ASCII values.  The procedure is reversed when decoding a line of text.Be certain,however,that the same random number is used in decodingas was used in encoding.

3398


Why we use break in c?

935


Explain what math functions are available for integers? For floating point?

1062


What is an expression?

1000