print the following using nested for loop.
5 4 3 2 1
1 2 3 4
3 2 1
1 2
1
2 1
1 2 3
4 3 2 1
1 2 3 4 5
Answer Posted / anand.dayalan@gmail.com
#include<stdio.h>
#include<conio.h>
void main()
{
for(int i=1; i<=2; i++)
for(int j=(i==1)?1:2;j<=5;j++)
{
for(int k = (j%2==1 && i==1)? 5 + 1 -j: (j%2==0 && i==2)?
j:1; (j%2==1 && i==1)? k>=1: (j%2==0 && i==2)? k>=1:(j%2==0
&& i==1)?k<=5 + 1 -j:k<=j ;(j%2==1 && i==1)? k--: (j%2==0 &&
i==2)? k--:k++)
printf("%d", k);
printf("\n");
}
}
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff
Write the syntax and purpose of a switch statement in C.
What is the deal on sprintf_s return value?
Explain what are run-time errors?
How do shell structures work?
Function calling procedures? and their differences? Why should one go for Call by Reference?
What is c standard library?
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
What is an array? What the different types of arrays in c?
What is structure and union in c?
Is a pointer a kind of array?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
What is size of union in c?
What is the need of structure in c?
Is there any data type in c with variable size?