how to find greatet of 10 numbers without using array?

Answer Posted / aman

int main()
{
int i, num;
int greatest=0;

for(i=0; i<10; i++)
{
scanf("%d", &num);
if(num > greatest)
greatest = num;
}
printf("greatest = %d", greatest);
return 0;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why & is used in c?

698


Why is c so important?

586


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1451


Differentiate between new and malloc(), delete and free() ?

655


write a program to find out prime number using sieve case?

1626






What is pass by reference in functions?

313


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

597


what are the different storage classes in c?

652


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

2363


Explain the concept and use of type void.

619


Write a program to reverse a given number in c language?

606


What are multibyte characters?

637


Can you write the algorithm for Queue?

1538


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

653


Why doesnt long int work?

599