Write a c program to sort six numbers and find the largest
one by using the ladder of if-else?
plz do help me
Answers were Sorted based on User's Feedback
Answer / sandeep kumar yadav. by m.c.a
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d,e,f,max;
clrscr();
printf("Enter the six Number \n");
scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
if(a>b && a>c && a>d && a>e && a>f)
max=a;
else if(b>a && b>c && b>d && b>e && b>f)
max=b;
else if(c>a && c>b && c>d && c>e && c>f)
max=c;
else if(d>a && d>b && d>c && d>e && d>f)
max=d;
else if(e>a && e>b && e>c && e>d && e>f)
max=e;
else if(f>a && f>b && f>c && f>d && f>e)
max=f;
printf("\n\n Maximum Number is = %d",max);
getch();
}
Is This Answer Correct ? | 35 Yes | 9 No |
Answer / jugal k. sewag
#include<stdio.h>
#include<conio.h>
void main(){
int a,b,c,d,e,f;
int max;
clrscr();
printf("Enter any six numbers: ");
scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
if(a>=b && a>=c && a>=d && a>=e && a>=f)
max =a;
else if(b>=c && b>=d && b>=e && b>=f)
max=b;
else if(c>=d && c>=e && c>=f)
max=c;
else if(d>=e && d>=f)
max=d;
else if(e>=f)
max=e;
else
max=f;
printf("Max among six number is: %d",max);
getch();
}
Is This Answer Correct ? | 14 Yes | 12 No |
Write a c program to find, no of occurance of a given word in a file. The word is case sensitive.
What is malloc calloc and realloc in c?
What is static memory allocation? Explain
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
1. Write the function int countchtr(char string[ ], int ch); which returns the number of times the character ch appears in the string. Example, the call countchtr(“She lives in NEWYORK”, ‘e’) would return 3.
c program to compute AREA under integral
please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics
What is variable in c example?
Find the output? void main() {float a=2.0; printf("\nSize of a ::%d",sizeof(a)); printf("\nSize of 2.0 ::%d",sizeof(2.0));}
11 Answers IBM, TCS,
What are the types of i/o functions?
What are the different types of storage classes in C?
Why doesn't C have nested functions?