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
What are the different types of C instructions?
How can I read/write structures from/to data files?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
What does return 1 means in c?
Is it possible to initialize a variable at the time it was declared?
What is equivalent to ++i+++j?
What is a memory leak? How to avoid it?
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
What are the features of c languages?
what are the facialities provided by you after the selection of the student.
Is c# a good language?
Explain the use of keyword 'register' with respect to variables.
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
What is a structure member in c?