Question
1. (20 points) What types of error is each of the following? *Forgot to add a ; when declaring a variable *When computing the area
1. (20 points) What types of error is each of the following? *Forgot to add a ; when declaring a variable *When computing the area of a circle, you used the formula: area = 2 * PI * radius.
2. (25 points) What happens when the statement below executes and the values -3, A, and 4.5 are entered?
int x; char y; double z; scanf("%d%c%f", &x, &y, &z);
3. (30 points) What is the output of the following code segment when the user enters the values: -13, C, and 12.45678 in order.
#include
decimal point: "); scanf ("%d%c%f", &x, &y, &z); x = x + 3; y = y - 1; z = x * z; printf(" x = %6d", x); printf(" y = %5c", y); printf( z = %8.3f", z); printf( Stop.);
3. (25points be precise and use correct terminology) a. (a one word answer will do for this question) What kind of a C language statement is
int x;
b. What is the effect of this statement? (What does the compiler do with this statement?)
c. What would happen during the compilation of your program if this statement were omitted from this code and the compiler later encountered the statement x = x + 3; ?
Instructions: Place your answers under each question. Write neatly and use correct English. Use the terminology you have been reading about. 1. (20 points) What types of error is each of the following? Forgot to add a; when declaring a variable *When computing the area of a circle, you used the formula: area = 2 * PI * radius. 2. (25 points) What happens when the statement below executes and the values -3, A, and 4.5 are entered? int x; char y double ; scanf("%d%c%f", &x, &y, &z); 3 (30 points) what is the output of the following code segment when the user enters the values:-13, C, and 12.45678 in order include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started