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
How we can insert comments in a c program?
I have a varargs function which accepts a float parameter?
What is a pointer variable in c language?
How can I manipulate individual bits?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What is the difference between typedef struct and struct?
Is it better to use malloc() or calloc()?
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
What are the main characteristics of c language describe the structure of ac program?
Can you write the algorithm for Queue?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
When do we get logical errors?
What is a global variable in c?
What are global variables and how do you declare them?
Is null always defined as 0(zero)?