Since this is likely a homework question, what will be provided here instead of code is information that you can use to write the code. (Half of the fun of programming is the problem solving and associated trouble shooting.)
Firstly, you need to know what kind of interface the application uses: console or graphical. That'll help you determine how you'll receive the information from the user (input) and how you're displaying the results (output).
Secondly, you know that you need comparison operators and a for() loop. Since "n" is the number of values you'll accept from the user, and say "c" is the counter value, your loop will look something like: for (c=0; c<n; c++) { [your code here] }
Then you'll need four additional variables:
- one to accept the user's data;
- one to store the number from the user;
- one to store the largest value;
- one to store the smallest value.
Be sure to initialise the largest value to the smallest number you can store, and the least value to the largest number you can store. I don't know which type you're instructed to use, but for a 32-bit "int" you're looking at a range of -2,147,483,647 to 2,147,483,648.
Also, the reason you need two variables for storing the user's inputs is because the user might enter non-numeric data. So store the user's input in a char[] array, then use atoi() to convert that into an integer, and you'll be able to avoid any problems with types since atoi() ignores everything after and including the first non-digit character.
Once you've got that number, compare it with the current largest value - if the user's number is greater, set the largest value to that number. If the user's number is lower than the least number, set the least number to that value.
Once the loop is finished, simply display the results, and you're done!
draw a flowchart to display the first tenth even number
Accept 5 numbers in an array and display it.
identification division. program-id. greatest. environment division. data division. working-storage section. 77 a pic 999. 77 b pic 999. 77 c pic 999. procedure division. greatest. display "ENTER THE THREE NUMBERS:". accept a. accept b. accept c. if a > b and a > c display a "is greatest" else if b > c display b "is greatest" else display c "is greatest". display " thank you". stop run.
It is very easy. The program begins here..... /*Program to sum and print numbers without creating variables*/ #include<stdio.h> main() { clrscr(); printf("%d+%d=%d",5,2,5+2); getch(); } /*Program ends here*/ Now just by changing the numbers in the "printf" statement we can add, subtract, multiply and divide the numbers without using variables. Hence the problem is solved..........
start input A & B if A>B print A is greatest if B>A print B is greatest stop james ola writes.....SOT.
write a c program to accept a number and generate a square root cube and exponential values
(ab)*b
draw a flowchart to display the first tenth even number
C programm
Accept 5 numbers in an array and display it.
identification division. program-id. greatest. environment division. data division. working-storage section. 77 a pic 999. 77 b pic 999. 77 c pic 999. procedure division. greatest. display "ENTER THE THREE NUMBERS:". accept a. accept b. accept c. if a > b and a > c display a "is greatest" else if b > c display b "is greatest" else display c "is greatest". display " thank you". stop run.
ACCEPT DATE [YYYYMMDD] This will do it
It is very easy. The program begins here..... /*Program to sum and print numbers without creating variables*/ #include<stdio.h> main() { clrscr(); printf("%d+%d=%d",5,2,5+2); getch(); } /*Program ends here*/ Now just by changing the numbers in the "printf" statement we can add, subtract, multiply and divide the numbers without using variables. Hence the problem is solved..........
start input A & B if A>B print A is greatest if B>A print B is greatest stop james ola writes.....SOT.
Yes, NYU does accept American Sign Language as a language that fulfills their language proficiency requirement. Students can demonstrate proficiency in ASL through placement tests or official certification.
Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end
Accept 3 natural numbers and check whether it firms pythagorean triplet