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 |
what is the purpose of the code, and is there any problem with it. bool f( uint n ) { return (n & (n-1)) == 0; }
c program to compute AREA under integral
how to use virual function in real time example
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
What is the diffences between Windows XP and Windows Visa
How would you print out the data in a binary tree, level by level, starting at the top?
write a program to reverse the words in the sentence.NOTE:not reverse the entire string but just the occurance of each word
why effort estimation is important?
Compare and contrast compilers from interpreters.
If errno contains a nonzero number, is there an error?
What is difference between structure and union?
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