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

How is a macro different from a function?

0 Answers   Tech Mahindra,


what does keyword ‘extern’ mean in a function declaration?

1 Answers   Emerson,


whitch value return void main?

11 Answers  


if ENTERED FIVE DIGITS DESIGN A PROGRAM THAT WILL FIND CORRESPONDING VALUE FROM ASCII TABLE

1 Answers  


how to find anagram without using string functions using only loops in c programming

1 Answers   Mind Tree, TCS,


what r callback function?

1 Answers  


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

0 Answers  


Where can I get an ansi-compatible lint?

0 Answers  


why we need function pointers?

3 Answers  


Is it cc or c in a letter?

0 Answers  


if p is a string contained in a string?

0 Answers  


how can i include my own .h file EX:- alex.h like #include<alex.h>, rather than #include"alex.h"

1 Answers  


Categories