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
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
Can you please compare array with pointer?
What is meant by high-order and low-order bytes?
What is difference between static and global variable in c?
Explain what is the benefit of using const for declaring constants?
Explain the difference between the local variable and global variable in c?
How can I invoke another program or command and trap its output?
What is uint8 in c?
What do you understand by normalization of pointers?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
What is the use of define in c?
What is pass by value in c?
Can we use visual studio for c?
What is the general form of function in c?