#include int main() { int i1; double d1; float f1; char c, newline; char str[50], str2[50]; // Character strings printf("Enter an integer: "); scanf("%d", &i1); //%d is a placeholder for and integer, //"&" means address of the variable //scanf reads the value into the address of the variable printf("Enter a float: "); scanf("%f", &f1); printf("Enter a double: "); scanf("%lf", &d1); scanf("%c", &newline); //reads a newline character - clears the // input buffer - only nec. when reading // a character printf("Enter a character: "); scanf("%c", &c); printf("Enter a character string: "); scanf("%s", str); //No "&" here, an array name represents the // starting address of the array. //"str" represents the starting address of the string printf("Integer: %d float: %f double: %lf\n", i1, f1, d1); printf("Character: %c string: %s\n", c, str); return 0; }