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 is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

0 Answers  


write a programme that inputs a number by user and gives its multiplication table.

2 Answers  


Explain how can I avoid the abort, retry, fail messages?

0 Answers  


What does %p mean?

0 Answers  


any "C" function by default returns an a) int value b) float value c) char value d) a & b

0 Answers  


how to build a exercise findig min number of e heap with list imlemented?

0 Answers  


what is the difference between arrays and linked list

26 Answers   MAHINDRA, Tech Mahindra, Wipro,


When should I declare a function?

0 Answers  


code snippet for creating a pyramids triangle ex 1 2 2 3 3 3

4 Answers  


What does typeof return in c?

0 Answers  


what is the difference between 123 and 0123 in c?

0 Answers  


How can I trap or ignore keyboard interrupts like control-c?

0 Answers  


Categories