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 purpose of the code, and is there any problem with it. bool f( uint n ) { return (n & (n-1)) == 0; }

1 Answers   Google,


c program to compute AREA under integral

1 Answers   Infosys,


how to use virual function in real time example

1 Answers   CTS, Wipro,


Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result

1 Answers  


What is the diffences between Windows XP and Windows Visa

1 Answers   Aricent, FHF,


How would you print out the data in a binary tree, level by level, starting at the top?

6 Answers   Amazon, Microsoft,


write a program to reverse the words in the sentence.NOTE:not reverse the entire string but just the occurance of each word

1 Answers   Sienna Ecad, Wipro,


why effort estimation is important?

1 Answers  


Compare and contrast compilers from interpreters.

1 Answers  


If errno contains a nonzero number, is there an error?

1 Answers  


What is difference between structure and union?

1 Answers  


int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above

1 Answers  


Categories