Tell me a C program to display the following Output?
1 1 1 1 1
2 2 2 2
3 3 3
4 4
5
Answer Posted / sreesen@ymail.com
#include<stdio.h>
void main()
{
int i,j,k=5;
for(i=1;i<=5;i++)
{
for(j=k;j<=0;j--)
{
printf("%d",i);
}
printf(""\n);
k--;
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is use of bit field?
Can we declare variable anywhere in c?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
Do you have any idea how to compare array with pointer in c?
Explain Basic concepts of C language?
main() { printf("hello"); fork(); }
Is multithreading possible in c?
Why is c platform dependent?
What is atoi and atof in c?
What is operator precedence?
What are inbuilt functions in c?
Which function in C can be used to append a string to another string?
What extern c means?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?