My logic in this code is to prompt the user for some inputs(int,float and a char) and print them back out saying "this is what you typed".Everything works fine and it compiles ok without errors or warnings but the "char" taken from the user is not being printed.What do I do to solve the issue? Also,the scanf() containing the %c for char ignores the "\n" that I put at the end of it.How to solve this one too? Heres my code :
#include <stdio.h>
#include <conio.h>
int main()
{
int a;
float b;
char c;
printf("Your Integer : ");
scanf("%i",&a);
printf("Your Float : ");
scanf("%f",&b);
printf("Your Char : ");
scanf("%c/0\n",&c);
printf(" ****You Inputted the Following Values : ****\n\n");
printf("The INTEGER Value Is : %i\n\nThe FLOAT Value Is : %f\n\nThe Character Value Is : %c " , a , b , c);
}
But I get a blank space for the char value!Help please! And I am using DEV C++ for this.That's the requirement of our University.