how can i get the output
54321
4321
321
21
1
in c programming........???? pls help......
Answers were Sorted based on User's Feedback
Answer / jayaraj.s
#include<stdio.h>
main()
{
int a,b;
for(a=5;a!=0;a--)
{
for(b=a;b!=0;b--)
{
printf("%d",b);
}
printf("\n");
}
getch();
}
Is This Answer Correct ? | 86 Yes | 16 No |
Answer / narasimharao
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
scanf("%d",&n);
for(i=n;i>=1;i--)
{
for(j=i;j>=1;j--)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
Is This Answer Correct ? | 28 Yes | 12 No |
Answer / dattatreya
#include<stdio.h>
int main(){
char a[6]="54321";
char *p=a;
while(*p){
printf("%s ",p++);
}
return 0;
}
Is This Answer Correct ? | 8 Yes | 3 No |
Answer / rishabh upadhyay
#include<stdio.h>
void main(){
int i,j=5,temp=0;
for (i=1;i<=5;i++)
{
for (j=5-temp;j>=1;j--)
{
printf("%d",j);
}
printf("
");
temp=temp+1;
}
}
Is This Answer Correct ? | 1 Yes | 4 No |
Answer / nagulmeera
#include<stdio.h>
#include<conio.h>
main()
{
for(int i=5;i<0;i--)
{
for(j=i;j!=0;j--)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
Is This Answer Correct ? | 4 Yes | 8 No |
Answer / mydeen
for(i=5;i<0;i++)
{
for(j=i;j<0;j++)
{
printf("%d",&i);
}
}
Is This Answer Correct ? | 3 Yes | 7 No |
Answer / aditya the future google ceo
(i=1;i<=5;i--)
{
(J=1;j<=i;j--)
Is This Answer Correct ? | 0 Yes | 4 No |
write a program to reverse the words in the sentence.NOTE:not reverse the entire string but just the occurance of each word
#include<stdio.h> void main() { int a=10,b=20,c=30; printf("%d",scanf("%d%d%d",&a,&b,&c)); } what is the output for this?
struct tag{ auto int x; static int y; };main() { struct tag s; s.x=4; s.y=5; printf(ā%dā,s.x); }
How can you draw circles in C?
What is the output for the program given below typedef enum grade{GOOD,BAD,WORST,}BAD; main() { BAD g1; g1=1; printf("%d",g1); }
read an array and search an element
Write a c code segment using a for loop that calculates and prints the sum of the even integers from 2 to 30, inclusive?
What is the difference between typedef and #define?
what is the height of tree if leaf node is at level 3. please explain
main() { int a[3][4] ={1,2,3,4,5,6,7,8,9,10,11,12} ; int i, j , k=99 ; for(i=0;i<3;i++) for(j=0;j<4;j++) if(a[i][j] < k) k = a[i][j]; printf("%d", k); }
4 Answers Vector, Wipro, Zoho,
Program to display given 3 integers in ascending order
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }