1. Write a program to:
2.
2. Choose the statement(s) that generate(s) this output: I
wish
you were here
a. |
printf("I wish", "you were here"); |
|
b. |
printf("I wish\n"); printf("you were here"); |
|
c. |
printf("I wish"); printf("you were here\n"); |
|
d. |
printf("I wish", \n, "you were here"); |
#include <stdio.h> int main(void) { int userInt; double userDouble; char userChar; char userString[1000]; printf("Enter integer:\n"); scanf("%d", &userInt); printf("Enter double:\n"); scanf("%lf", &userDouble); printf("Enter character:\n"); scanf(" %c", &userChar); printf("Enter string:\n"); scanf("%s", userString); printf("%d %.2lf %c %s\n", userInt, userDouble, userChar, userString); printf("%s %c %.2lf %d\n", userString, userChar, userDouble, userInt); printf("%.2lf cast to an integer is %d\n", userDouble, (int) userDouble); return 0; }
b. |
printf("I wish\n"); printf("you were here"); |
Get Answers For Free
Most questions answered within 1 hours.