Hi, i am stuckon this particular assignment. I will appreciate it if you guyz help me out on these problems..............
1.
Write two functions Max( ) and Min( ) where
• max() returns the maximum of two integers
• min() returns the minimum of two integers
• Each function takes two function arguments and returns a single value.
• There should be no scanf() or printf() used in these functions.
Write a simple driver program that demonstrates the use of both of these functions.
Write two parametric macros based on the above specifications.

2.
Write a program based on assignment 5.1 GetStr() which prompts the user to enter a series of input values. The program should then make some intelligent decision about the behaviour of the input values. That is, your program should be able to determine the types of input. Print a message to inform the user what type of input was entered. The following table depicts the message to print for a given type of input values:

Input Type Message to Display Example Input
integer Integer value detected 1, 4, 2000, 0, 45, -5
floating point Floating point value detected 1.234, -1.234, 200.201
character Single character detected A, B, d, %, #, $, *
string Character string detected ABC, $123.3, 45.5$CAD

Hint: You must parse the array that contains the input value. For integer, each array element must be a numeric with no decimal point detected. A floating point follows that of an integer but with an optional decimal point. There can only be one decimal point. Be sure to handle the leading sign (+ or -). A single character has a length of 1 and the second array element being a null termination. All others are character strings. You do not have to handle scientific notation in this assignment. Treat numbers expressed as scientific notation as character strings. Provide a flow chart describing the algorithm used.

And what seems to be the problem? You should post a little code so we can help you out where you get the problem. No one is going to do your work for you.

This article has been dead for over six months. Start a new discussion instead.