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 in c to print
1
121
12321
1234321
123454321

Answers were Sorted based on User's Feedback



Write a program in c to print 1 121 12321 1234321 1234..

Answer / vivek raghuwanshi

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,num;
cout<<num;
for(i=1;i<=num;i++)
{
for(j=1;j<i-1;j++)
{
cout<<" ";
}
for(k=1;k<i;k++)
{
cout<<k;
}
for(k=i;k>=1;k--)
{
cout<<k;
}
}
}

Is This Answer Correct ?    13 Yes 31 No

Post New Answer

More C Interview Questions

Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

5 Answers   TCS, Vimukti Technologies,


What is the most efficient way to count the number of bits which are set in an integer?

0 Answers  


main() { int i = -3,j=2,k=0,m; m= ++i || ++j && ++k; printf("%d%d%d",i,j,k,m); }

7 Answers   HCL,


What is a structure and why it is used?

0 Answers   Hexaware,


how to print "hai" in c?

13 Answers   TCS,


write function to reverse char array ... without using second array

3 Answers  


Explain the meaning of keyword 'extern' in a function declaration.

0 Answers  


What is a macro, and explain how do you use it?

0 Answers  


1.write a program to merge the arrays 2.write efficient code for extracting unique elements from a sorted list of array?

3 Answers   Qualcomm,


What is a static variable in c?

0 Answers  


how many errors in c explain deply

0 Answers  


What is structure and union in c?

0 Answers  


Categories