Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a C program that will: Create two int variables: myint /* stores an intege

ID: 3628613 • Letter: W

Question

Write a C program that will:
Create two int variables:
   myint /* stores an integer */
   mychar /* stores a single character value */
Prompt the user for an integer value (use a printf statement)
Input an int value and store it in myint (use a scanf statement)
Prompt the user for a single character (A – Z)
Input a char value and store it in mychar
Output the value of myint in a line of text that tells the user this is the integer you input
Output the value of mychar in a line of text that tells the user this is the character you input
Always end your last output (printf) with a NL character ‘ ’ to force any following text to the next line on the screen.
Use a return statement to end your program.

Explanation / Answer

#include<stdio.h>
#include<conio.h> // remove thisifu are in linux.
void main()
{
int myint;
char mychar;
printf(" Enter an Integer Value :");
scanf("%d",&myint);
printf(" Enter a Character (A-Z):");
mychar=getche();
getche();
printf(" The integer you input is :%d",myint);
printf(" The character you input is :%c",mychar);
getch();
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote