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...


1 1
12 21
123 321
12344231 how i creat it with for loop??



1 1 12 21 123 321 12344231 how i creat it with for loop??..

Answer / raju kalyadapu

#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,k;
for(i=1;i<=4;i++) //Outer Loop
{
for(j=1;j<=4;j++) //Inner loop for left side pattern
{
if(j<=i) //condition for checking printing space or number
printf("%d",j);
else
printf(" ");

}


for(j=4;j>=1;j--) //Inner loop for right side pattern
{
if(j<=i) //condition for checking printing space or number
{
printf("%d",j);
}
else
printf(" ");

}
printf("
");

}
getch();
return 0;
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What are the header files used in c language?

0 Answers  


What is your favorite subject?

1 Answers   Ericsson, Invendis, Tech Mahindra,


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

0 Answers  


What is the collection of communication lines and routers called?

0 Answers  


Why header files are used?

0 Answers  


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

0 Answers   Wilco,


explain what are actual arguments?

0 Answers  


write c program without semicolon

11 Answers   MindTech, TCS, Wipro,


Explain what is the benefit of using const for declaring constants?

0 Answers  


Who is the main contributor in designing the c language after dennis ritchie?

0 Answers  


What is masking?

0 Answers  


What is an lvalue?

0 Answers  


Categories