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.

Answers were Sorted based on User's Feedback



how to find out the biggest element (or any other operation) in an array which is dynamic. User ne..

Answer / 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

how to find out the biggest element (or any other operation) in an array which is dynamic. User ne..

Answer / rahul

soory i dont no but i need this Answer

Is This Answer Correct ?    0 Yes 3 No

how to find out the biggest element (or any other operation) in an array which is dynamic. User ne..

Answer / 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

More C Interview Questions

What is a const pointer in c?

0 Answers  


What is a floating point in c?

0 Answers  


What is the meaning of && in c?

0 Answers  


int main() { int i=1; switch(i) { case '1': printf("hello"); break; case 1: printf("Hi"); break; case 49: printf("Good Morning"); break; } return 0; }

3 Answers  


What is the restrict keyword in C?

2 Answers  


How do you use a pointer to a function?

0 Answers  


Explain what is the general form of a c program?

0 Answers  


What is the output of the following program main();{printf ("chennai""superkings"}; a. Chennai b. superkings c. error d. Chennai superkings

6 Answers  


What are the types of assignment statements?

0 Answers  


int arr[] = {1,2,3,4} int *ptr=arr; *(arr+3) = *++ptr + *ptr++; Final contents of arr[]

6 Answers   Hughes,


What are the string functions? List some string functions available in c.

0 Answers  


How can I implement sets or arrays of bits?

0 Answers  


Categories