The assignment is:
A. Present a menu like the following:
1. Enter a char
2. Enter a string
3. Enter a float
4. Enter an integer
5. Display the sqaure of numbers from 1-100
9. Quit the Program
Enter the Program
B.The program should not quit until the user chooses to quit by entering "9". You must use either a do/while loop or a while loop for this purpose.
C. Depending on the choice the user makes, allow the user to enter that variable type, display it on the screen and prompt for themenu again.
D. For choice 2 (Enter a String) in the menu, output the string user entered as all lowercase and all uppercase letters.
E. For choice 3 and 4 from the menu in step 1,, if the number the user entered was negative, display a message: "You entered a negative number." Similarly, if the user enered a positive number, display: "You entered a positive numbers."
F. For choice 5, use an integer variable. Must use a "for" loop to display the squares of all numbers from 1-100. Example output:
Square of 1 is 1
Square of 2 is 4
Square of 3 is 9
.....
Square of 100 is 10000
BELOW are the code i wrote so far. Im stuck on Part C. And I don't know where to add the code for PArt C-E. Any help would be appreciated.
#include "stdafx.h"
#include <stdio.h>
int main (void)
{
int myChoice;
do
{
printf ("\nMAIN MENU\n\n");
printf ("1. Enter a char\n");
printf ("2. Enter a string\n");
printf ("3. Enter a float\n");
printf ("4. Enter an integer\n");
printf ("5. Display the square of numbers from 1-100\n");
printf ("9. Quit the Program\n\n");
printf ("Enter your choice. ");
scanf_s ("%i", &myChoice);
}
while (myChoice != 9);
return 0;
}