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
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
What are header files in c programming?
Explain how do you determine the length of a string value that was stored in a variable?
Write a C program in Fibonacci series.
What is the difference between procedural and declarative language?
Is calloc better than malloc?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
Can we declare a function inside a function in c?
What is the difference between a function and a method in c?
Is register a keyword in c?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
What is #pragma statements?
What is the difference between pure virtual function and virtual function?
write a program to print data of 5 five students with structures?
Is there a built-in function in C that can be used for sorting data?