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 |
List some of the dynamic data structures in C?
code for copying two strings with out strcpy() function.
how to find string length wihtout using c function?
how to count no of words,characters,lines in a paragraph.
what is the output of following question? void main() { int i=0,a[3]; a[i]=i++; printf("%d",a[i] }
I want tcs placement papers of 2004-2009 , its urgent
What is meant by type casting?
What are preprocessor directives?
Difference between C and Embedded C?
consider the following C code main() { int i=3,x; while(i>0) { x=func(i); i--; } int func(int n) { static sum=0; sum=sum+n; return(sum); } the final value of x is
What is %g in c?
with out using main how to execute the program?