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
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
What is the value of uninitialized variable in c?
In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]
What are Macros? What are its advantages and disadvantages?
What is type qualifiers?
How can I prevent another program from modifying part of a file that I am modifying?
What is the difference between strcpy() and memcpy() function in c programming?
What does 2n 4c mean?
What is signed and unsigned?
What is the use of structure padding in c?
Explain how can I convert a string to a number?
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
Can math operations be performed on a void pointer?
Explain the difference between exit() and _exit() function?