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 / vignesh1988i
it is said that while executing also the user should not specify the size means it can be done in another method without using ARRAYS......... using only one variable.. since it is asked to find only the biggest element , this program suits.....
#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();
}
thank u
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
How arrays can be passed to a user defined function
What is the use of bitwise operator?
Can a void pointer point to a function?
How do you determine whether to use a stream function or a low-level function?
Explain goto?
Why n++ execute faster than n+1 ?
There seem to be a few missing operators ..
What do the functions atoi(), itoa() and gcvt() do?
Explain pointer. What are function pointers in C?
How are Structure passing and returning implemented by the complier?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
What are the advantages and disadvantages of c language?
What is the maximum no. of arguments that can be given in a command line in C.?
Is there any demerits of using pointer?