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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is signed and unsigned?

1124


What does the message "automatic aggregate intialization is an ansi feature" mean?

1245


what is recursion in C

1117


When should volatile modifier be used?

1076


Explain the priority queues?

1141


Explain what does it mean when a pointer is used in an if statement?

1108


What is cohesion and coupling in c?

1097


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1294


What are the types of type qualifiers in c?

1140


Dont ansi function prototypes render lint obsolete?

1201


What are the 5 types of organizational structures?

1133


What is the size of structure in c?

1216


C program to find all possible outcomes of a dice?

2410


How can I split up a string into whitespace-separated fields?

1109


How to get string length of given string in c?

1125