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 are the header files used in c language?
What is your favorite subject?
1 Answers Ericsson, Invendis, Tech Mahindra,
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
What is the collection of communication lines and routers called?
Why header files are used?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
explain what are actual arguments?
write c program without semicolon
11 Answers MindTech, TCS, Wipro,
Explain what is the benefit of using const for declaring constants?
Who is the main contributor in designing the c language after dennis ritchie?
What is masking?
What is an lvalue?