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
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 |
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 |
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 |
write a program that eliminates the value of mathematical constant e by using the formula e=1+1/1!+1/2!+1/3!+
without using control structures and control structures find the max and min of given 2 nos
why java is called as a purely oops language.
Are the outer parentheses in return statements really optional?
Explain zero based addressing.
What are local and global variables?
why we shiuld use main keyword in C
What is the difference b/w main() in C language and main() in C++.
x=2,y=6,z=6 x=y==z; printf(%d",x)
13 Answers Bharat, Cisco, HCL, TCS,
Why main is used in c?
How to compare array with pointer in c?
code for replace tabs with equivalent number of blanks