how to find out the biggest element (or any other
operation) in an array which is dynamic. User need not to
mention the array size while executing.
Answer Posted / vignesh1988i
it is said that while executing also the user should not specify the size means it can be done in another method without using ARRAYS......... using only one variable.. since it is asked to find only the biggest element , this program suits.....
#include<stdio.h>
#include<conio.h>
void main()
{
int n,BIG;
printf("enter the numbers :");
scanf("%d",&n);
BIG=n;
do
{
fflush(stdin);
scanf("%d",&n);
if(n>=BIG)
BIG=n;
}while(((char)n>=65)&&((char)<=122));
printf("the biggest number is : %d",BIG);
getch();
}
thank u
Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
What is structure and union in c?
Why c is called a mid level programming language?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
What are Macros? What are its advantages and disadvantages?
Why c language?
What is the correct declaration of main?
Explain output of printf("Hello World"-'A'+'B'); ?
What header files do I need in order to define the standard library functions I use?
Difference between Function to pointer and pointer to function
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
What are predefined functions in c?
Can we compile a program without main() function?
what do you mean by inline function in C?
How many levels deep can include files be nested?
What is the explanation for modular programming?