how can i get output the following...
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1
and
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
plz plz...
Answer Posted / abhishek karnani
void main ()
{
int i,k,j;
clrscr();
for (i=0;i<5;i++)
{
for (j=5;j>=i+1;j--)
{
printf ("%d",j);
}
printf("\n");
for (k=0;k<j+1;k++)
{
printf(" ");
}
}
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is nested structure in c?
Explain the use of 'auto' keyword in c programming?
Why can’t we compare structures?
What is exit() function?
How many levels of indirection in pointers can you have in a single declaration?
What is the difference between new and malloc functions?
Explain the concept and use of type void.
Can we change the value of static variable in c?
Why is c used in embedded systems?
Explain About fork()?
Do you have any idea how to compare array with pointer in c?
What are the types of data types and explain?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
What is sizeof in c?