Help with code Write a program called lab6 C which will prom
Help with code
 Write a program called lab6. C which will prompt the user to enter a single letter or a single digit number on the keyboard. If the user enters a lower ease letter, the program will print out the same letter as a capital letter If the user enters a capital letter, the program will print out the same letter in lower ease. If the user enters an even number, the program will print out a message saying that it is an even number If the user enters an odd number, the program will print out a message saying that it is an odd number. If the user enters anything that ts not a letter or a number, the program will print out a message indicating that they entered an invalid character The message your program prints out must be exactly as show n in the examples below the next paragraph.  Once you get that working, make the program loop continually, asking the user if they want to go again, using a 1 for yes and a 0 for no. If they enter a 1, then they will be prompted to enter a single letter or number on the keyboard again,  displaying the results explained above. If they enter a 0, then the program will quit. With this loop added, your output should look like the following examples  Enter a letter or number from the keyboard, d  The upper case of that letter is: D.  Would you like to go again? Enter 1 for yes, 0 for no. 1  Enter a letter or number from the keyboard. R  The lower case of that letter is: r.  Would you like to go again? Enter 1 for yes, 0 for no. 1  Enter a letter or number from the keyboard. 6  You entered an even number.  Would you like to go again? Enter 1 for yes, 0 for no. 1  Enter a letter or number from the keyboard. 3  You entered an odd number.  Would you like to go again? Enter 1 for yes, 0 for no. 1  Enter a letter or number from the keyboard. ?  You entered an invalid character.  Would you like to go again? Enter 1 for yes, 0 for no. 0  Once you are certain that your program works with the addition of the loop, add some code that will check for invalid input for going again (this code should prompt the user repeatedly if the input is not 0 or 1). For example:  Enter a letter or number from the keyboard. 5  You entered an odd number.  Would you like to go again? Enter 1 for yes, 0 for no. 9  Invalid input. Enter a 1 to go again, or a 0 to quit: 3  Invalid input. Enter a 1 to go again, or a 0 to quit: 5  Invalid input. Enter a 1 to go again, or a 0 to quit: 7  Invalid input. Enter a 1 to go again, or a 0 to quit: 6  Invalid input. Enter a 1 to go again, or a 0 to quit: 2  Invalid input. Enter a 1 to go again, or a 0 to quit: 4  Invalid input. Enter a 1 to go again, or a 0 to quit: 8  Invalid input. Enter a 1 to go again, or a 0 to quit: 0Solution
#include <stdio.h>
 #include <ctype.h>
int main()
 {
 
 do{
 char c;
 printf(\"Enter a character: \");
 scanf(\"%c\",&c);
if(isalpha(c)){
 if(c>=\'a\' && c<=\'z\')
 printf(\"The Uppercase of that letter id: %c\",toupper(c));
 else if(c>=\'A\' && c<=\'Z\')
 printf(\"The Lowercase of that letter id: %c\",tolower(c));
 }
 else if(isdigit(c)){
 if((c%2) == 0)
 printf(\"You Entered an even number\");
 else
 printf(\"You Entered an odd number\");
 }
 printf(\"To continue enter 1 else 0\");
 int a;
 scanf(\"%d\", &a);
 }while(a == 1);
 return 0;
 }

