Store the numbers in a suitable container such as an array. Assume the first number is the smallest and assign its value to a local variable. Traverse the remainder of the sequence, comparing each element's value to the stored value. If an element has a lower value, assign its value to the local variable. When the sequence is fully traversed, the local variable will hold the value of the smallest value in the sequence. Return that value.
this is nested if statement cls input"enter percent age of marks:" ,x if x>=50 and x>=100 then print"first division" elseif x>=50 and x< 60 then print"second division" elseif x>=33 and x<50 then print"third division" else print"fail" endif
Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end
Store the first value in the matrix, then compare every value in the matrix with the stored value, replacing the stored value if the current value is smaller. For instance, the following snippet will locate the smallest int value in a 3x4 matrix named A: int smallest=A[0][0]; for(int x=0; x<3; ++x ) { for(int y=0; y<4; ++y ) { if(A[x][y]<smallest ) { smallest=A[x][y]; } } }
#include #include #include int main(int argc, char *argv[]){int n, smallest, largest, sum, temp;if(argc < 2){printf("Syntax: foo val1[val2 [val3 [...]]]\n");exit(1);}smallest = largest = sum = atoi(argv[1]);for(n = 2; n < argc; n++){temp = atoi(argv[n]);if(temp < smallest) smallest = temp;if(temp > largest) largest = temp;sum += temp;}printf("Smallest: %i\nLargest: %i\nAverage: %i\n", smallest, largest, sum / (argc - 1));return 0;}
Write a program that calculates the area of a triangle in QBASIC
The range is the largest value minus the smallest value from a set of numbers.
its easy.. just compare all the numbers you will find the largets and the smallest one.
to find the median in a set of numbers you have to order them from the smallest to the largest and find the middle value e.g. 2,4,3,7,1 1,2,3,4,7 the median is 3
Most computer languages use the asterisk, "*", for multiplication.
The middle or mid value is easy to find....it is what it sounds like. If you have a group of numbers, you identify the largest and smallest, and then calculate the halfway point (largest # - smallest #). Then, from your group of numbers, identify the number closest to the number you came up with. If you are seeking a mid value from only two numbers, just subtract the smaller from the larger number and that's your answer.
If 0 is the smallest value in your data, then yes use zero to find the range.
You can find the range of any set of numbers by subtracting the smallest value from the largest value, eg. in the set 1, 3, 5, 6, 7, 8 the range would be 8-1, or 7.
The range is the distance from the smallest value to the largest value. This is equivalent to the largest value MINUS the smallest value. Therefore you subtract.
The smallest is 0o0'0'' and the largest is 180o0'0''
the two smallest numbers are 49 and 14
set all you numbers up in order from smallest to largest. then find the middle. if there are two number in the middle, add them up and divide by two. Example: set of numbers - 8,6,3,4,10,15,36 put in order from smallest to largest - 3,4,6,8,10,15,36 now find the middle number - 8 8 is then my median of this sequence
When you are given some numbers just arrange them in ascending order and you will the smallest number which can be made out of those given numbers.