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 package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
write a programme that inputs a number by user and gives its multiplication table.
Explain how can I avoid the abort, retry, fail messages?
What does %p mean?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
how to build a exercise findig min number of e heap with list imlemented?
what is the difference between arrays and linked list
26 Answers MAHINDRA, Tech Mahindra, Wipro,
When should I declare a function?
code snippet for creating a pyramids triangle ex 1 2 2 3 3 3
What does typeof return in c?
what is the difference between 123 and 0123 in c?
How can I trap or ignore keyboard interrupts like control-c?