Computer Science: A Structured Programming Approach Using C, Third Edition
Computer Science: A Structured Programming Approach Using C, Third Edition
3rd Edition
ISBN: 9780534491321
Author: Behrouz A. Forouzan, Richard F. Gilberg
Publisher: Course Technology, Inc.
Expert Solution & Answer
Book Icon
Chapter 3, Problem 25PS

Explanation of Solution

Given: The following code is given:

int a;

int b;

a = b = 50;

printf("%4d %4d",a,b);

a = a *2;

b = b / 2;

printf("%4d %4d", a, b); 

To Find: The output of the following code.

int a;

int b;

a = b = 50;

printf("%4d %4d",a,b);

a = a *2;

b = b / 2;

printf("%4d %4d", a, b);  

Solution:

The following code on being run will display the following output.

50 50 100 25

The program declares a and b as variables.

The reserved word, int, indicates a and b with integer values stored in the computer.

In the second step, the program store the values of a and b, that is, 50...

Blurred answer
Students have asked these similar questions
What's wrong with this code? float q;int *p;q = 100.7;p = &q;
what is the output of the following code segment? int x = 350; int y = 0; do { y +=x 0; X = x/10; } while (x!=0); cout<
Need help only with the highlighted part no need for help with the code  the code is just for reference    #include <stdio.h>   int printBin(int value);   int main(){   int num=10; int tobinary= printBin(num); printf("The number %d  converted to binary as %d",num,tobinary);     unsigned int x = 1;   char *ccc = (char*)&x;   if(*ccc){     printf("This is Little endian"); } else{     printf("This is Big endian"); }   getchar();   return 0;   }   int printBin(int value) {   if(value<2) return value;     return printBin(value / 2) *10 + value % 2;     }

Chapter 3 Solutions

Computer Science: A Structured Programming Approach Using C, Third Edition

Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr