0

Comparing Numbers

How can I write a C code where there is only one input and have to compare two numbers using only one input?

10th May 2025, 9:34 AM
Bhuvanesh Vinayak Sirsikar
Bhuvanesh Vinayak  Sirsikar - avatar
8 ответов
+ 3
There are many ways to do that:- let one value be already defined and other by user input let one value be randomly selected and other by user input
10th May 2025, 9:46 AM
Alhaaz
Alhaaz - avatar
+ 2
Is the requirement to read a single string as input, and then extract the two numbers for comparison out from the string?
10th May 2025, 11:02 AM
Brian
Brian - avatar
+ 1
Bhuvanesh Vinayak Sirsikar can you explain more about the "one input" and "two numbers"? What is in the input? What two numbers are to be compared, and from where do they come? What are the data types of all the above? Is the one input to be the name of a file from which the two numbers are read? Please give an example. Also, give detail on what is the expected output of the program.
10th May 2025, 3:16 PM
Brian
Brian - avatar
+ 1
Bhuvanesh Vinayak Sirsikar yes, thank you. The picture is coming into focus. An example would still clear further questions. As yet unclear is how to infer what is meant by "system". It may be the Command Line Interface (CLI) where you enter all input on the same command line as the executable name when you run a program. Also it may be a C function definition that takes as input a variable number of signed integer arguments. What do you suppose was intended for how it would be used?
10th May 2025, 4:22 PM
Brian
Brian - avatar
0
Thank you for responding but do you have any idea where by without using defined value
10th May 2025, 11:02 AM
Bhuvanesh Vinayak Sirsikar
Bhuvanesh Vinayak  Sirsikar - avatar
0
No Brain ,the question is you have only one input to give but you have to compare two numbers
10th May 2025, 12:00 PM
Bhuvanesh Vinayak Sirsikar
Bhuvanesh Vinayak  Sirsikar - avatar
0
Heres the meaning of the question: There is a system that takes only one input where we can pass multiple numbers ,with a data type signed integer ,and whose output compares those numbers and tells me which is the lowest or the highest. Let's say I pass two integers one after the other and I need to compare those two numbers and display which is highest and which is lowest. Now how to write the same in C language. Hope Brain you got it?
10th May 2025, 3:53 PM
Bhuvanesh Vinayak Sirsikar
Bhuvanesh Vinayak  Sirsikar - avatar
0
You are right Brain
11th May 2025, 1:36 AM
Bhuvanesh Vinayak Sirsikar
Bhuvanesh Vinayak  Sirsikar - avatar
OSZAR »