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 use of fflush() function?
Explain how can a program be made to print the line number where an error occurs?
In c programming language, how many parameters can be passed to a function ?
What is the process to create increment and decrement stamen in c?
int i=0,j; j=++i + ++i ++i; printf(" %d",j);
Read two numbers from keyboard and find maximum of them?
What is the -> in c?
What is conio h in c?
1. What will be the output of the following programs. a) #include <stdio.h> Main() { Int x=4; While(x==1) { X=x-1; Printf(ā%dā,x); --x; } }
What's the total generic pointer type?
who is the editor of 'pokemon'?
what is the difference between char * const and const char *?