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


Please Help Members By Posting Answers For Below Questions

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

1908


Explain how many levels deep can include files be nested?

630


Can two or more operators such as and be combined in a single line of program code?

813


How can I write functions that take a variable number of arguments?

631


Is r written in c?

731






WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2031


What are 'near' and 'far' pointers?

625


Why do we use static in c?

636


What's the best way of making my program efficient?

631


please explain every phase in the "SDLC" in the dotnet.

2182


Explain what are the standard predefined macros?

655


What is a pointer variable in c language?

649


What is a #include preprocessor?

623


What is type qualifiers?

669


What is memcpy() function?

624