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 a buffer in c?

945


Is javascript written in c?

1011


Can you think of a logic behind the game minesweeper.

2412


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1880


Why we use void main in c?

1095


How many types of errors are there in c language? Explain

924


What is volatile variable in c?

1050


How old is c programming language?

958


What is chain pointer in c?

1003


write a program to display all prime numbers

1909


Is it possible to execute code even after the program exits the main() function?

1277


How can I do peek and poke in c?

1032


Do you have any idea how to compare array with pointer in c?

986


#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

1907


Which built-in library function can be used to match a patter from the string?

1235