write a programme to enter some number and find which
number is maximum and which number is minimum from enterd
numbers.
Answer Posted / 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 View All Answers
Why isn't any of this standardized in c? Any real program has to do some of these things.
What is the stack in c?
What is static identifier?
Explain main function in c?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
When should the const modifier be used?
What is the difference between a function and a method in c?
Can include files be nested? How many levels deep can include files be nested?
What does malloc () calloc () realloc () free () do?
Explain the difference between the local variable and global variable in c?
Are global variables static in c?
What are examples of structures?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
What does %2f mean in c?
Write a program to print "hello world" without using a semicolon?