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
Difference between pass by reference and pass by value?
What is function and its example?
What are the different types of pointers used in c language?
How can I make it pause before closing the program output window?
What are pointers? Why are they used?
What is the difference between c and python?
What is the use of putchar function?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
What is the best way of making my program efficient?
Differentiate between static and dynamic modeling.
How do you print only part of a string?
Explain how can I manipulate strings of multibyte characters?
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
How are strings stored in c?
Why do we need volatile in c?