/*	Srineeth Alapati
	September 20, 2022
	Lab Section 7
	Lab #4
	Asks the user to enter letters and integers and outputs their respective 
	upper and lowercase letters, ASCII values, ASCII characters, and cube
*/


#include <stdio.h>
#include <math.h>

	int main (void) {
		
		char capital;
		char lower;
		int num1;
		int num2;
		
		//Asks user to enter a capital letter, a lowercase letter, an integer between 33 and 126, and any other integer
		fprintf (stderr, "Enter a capital letter: ");
		scanf (" %c", &capital);

		fprintf (stderr, "Enter a lowercase letter: ");
		scanf (" %c", &lower);

		fprintf (stderr, "Enter an integer (33 - 126): ");
		scanf (" %i", &num1);

		fprintf (stderr, "Enter an integer: ");
		scanf (" %i", &num2);

		
		//Prints the lowercase of the entered capital letter and the lowercase of that letter's ASCII values in a table
		printf ("The lowercase of %c is: %c \n", capital, capital+32);
		printf ("The ASCII values for %c are: \n", capital+32);
		printf ("%-16s%-16s%-16s \n", "DECIMAL", "OCTAL", "HEX");
		printf ("%-16d%#-16o%#-16x \n", capital+32, capital+32, capital+32);


		//Prints the uppercase of the entered lowercase letter and the uppercase of that letter's ASCII values in a table
		printf ("The uppercase of %c is: %c \n", lower, lower-32);
		printf ("The ASCII values for %c are: \n", lower-32);
		printf ("%-16s%-16s%-16s \n", "DECIMAL", "OCTAL", "HEX");
		printf ("%-16d%#-16o%#-16x \n", lower-32, lower-32, lower-32);


		//Prints the ASCII character of the entered integer that is between 33 and 126
		printf ("The ASCII character of %i is: %c \n", num1, num1);

		//Prints the entered integer cubed		
		printf ("%i cubed is %.1f \n", num2, pow(num2, 3.0));

		return 0;
	}
