Which of the following code segments contains an error?   a. int *number; printf("%d\n", &*number);   b. float x = 2.5; int xPtr = &x; printf("%d\n", xPtr);   c. int *number; printf("%d\n", &number);   d. None of these options e. float x = 2.5; float xPtr = &x; printf("%f\n", xPtr);

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter2: Using Data
Section: Chapter Questions
Problem 14RQ: Which of the following C# types cannot contain floating-point numbers? a. float b. double c. decimal...
icon
Related questions
Question

Which of the following code segments contains an error?

 

a.
int *number;
printf("%d\n", &*number);
 
b.
float x = 2.5;
int xPtr = &x;
printf("%d\n", xPtr);
 
c.
int *number;
printf("%d\n", &number);
 
d.

None of these options

e.
float x = 2.5;
float xPtr = &x;
printf("%f\n", xPtr);
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,