Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
33 views1 page

Q7

The document contains a C program that prompts the user to enter an integer, a float, and a character. It then reads these inputs and prints them back to the console. However, there is an error in the scanf format specifier for the float input, which should be '%f' instead of '%d'.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views1 page

Q7

The document contains a C program that prompts the user to enter an integer, a float, and a character. It then reads these inputs and prints them back to the console. However, there is an error in the scanf format specifier for the float input, which should be '%f' instead of '%d'.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <stdio.

h>
int main()
{
int a;
float b;
char chr;

printf("Enter an integer: \n");


scanf("%d", &a);
printf("Enter a float: \n");
scanf("%d", &b);
printf("Enter a character: \n");
scanf("%c", &chr);

printf("You entered:\n");
printf("%d\n", a);
printf("%f\n", b);
printf("%c\n", chr);
return 0;
}

You might also like