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 / sudarsan
#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();
}
it is a good one..
But if the user not give the array size,by using sizeof()
operator we can find the array size then by dividing the
total size with the size of data type ,we can find the
number of elements in the array then after we can find the
largest number of the array .
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
Explain how many levels deep can include files be nested?
Can two or more operators such as and be combined in a single line of program code?
How can I write functions that take a variable number of arguments?
Is r written in c?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
What are 'near' and 'far' pointers?
Why do we use static in c?
What's the best way of making my program efficient?
please explain every phase in the "SDLC" in the dotnet.
Explain what are the standard predefined macros?
What is a pointer variable in c language?
What is a #include preprocessor?
What is type qualifiers?
What is memcpy() function?