×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include
int main() { // Create an int and a char variable int myNum; char myChar; // Ask the user to type a number AND a character printf("Type a number AND a character and press enter: \n"); // Get and save the number AND character the user types scanf("%d %c", &myNum, &myChar); // Print the number printf("Your number is: %d\n", myNum); // Print the character printf("Your character is: %c\n", myChar); return 0; }
Type a number AND a character and press enter: 5b
Your number is: 5
Your character is: b