write a programme to enter some number and find which
number is maximum and which number is minimum from enterd
numbers.

Answers were Sorted based on User's Feedback



write a programme to enter some number and find which number is maximum and which number is minimu..

Answer / hari.11

#include<stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
printf("%d", a>b ? a : b);
return 0;
}

for further queries and discussions, visit..

http://forum.campusmaniac.com/
http://www.campusmaniac.com/

Is This Answer Correct ?    2 Yes 0 No

write a programme to enter some number and find which number is maximum and which number is minimu..

Answer / deepshree sinha

#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,a[100],max=-999,min=999;
printf("enter how many no. u wanna enter");
scanf("%d ",&n);
printf("enter that values");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
if(a[i]>max)
{
max=a[i];
}
if(a[i]<min)
{
min=a[i];
}
}
printf("max=%d,min=%d",max,min);
getch();
}

Is This Answer Correct ?    1 Yes 0 No

write a programme to enter some number and find which number is maximum and which number is minimu..

Answer / nitin garg

#include<stdio.h>
#include<conio.h>
#include<string.h>

int main()
{
int num[5],i,small=0,large=0;
printf("enter 5 no
");
for(i=0;i<5;i++)
{ scanf("%d",&num[i]);
}
small=num[0];
for(i=0;i<5;i++)
{
if(num[i]>large)
large=num[i];
if(num[i]<small)
small=num[i];
}

printf("
Larger no is: %d",large);
printf("

Smaller no is: %d",small);

getch();
return 0;
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What are header files? What are their uses?

0 Answers  


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

0 Answers  


What is array of structure in c?

0 Answers  


write a c program to find largest number in matrix(in each row,each column, diagonally, and in the whole matrix)? Its urgent.

2 Answers  


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

0 Answers  






Why does not use getgh(); and <conio.h> in c language.

3 Answers   Elofic,


wat is the meaning of c?

9 Answers   CTS, IBM, Wipro,


What is a const pointer?

0 Answers  


pascal triangle program

2 Answers  


How are pointers declared in c?

0 Answers  


Is c easier than java?

0 Answers  


What are runtime error?

0 Answers  


Categories