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
#include <stdio.h>int main() {    int x = 5866, y = 5455;    int z = x;    x = y;    y = z;    printf("%d %d", x, y);    return 0;}   Give output of this c code.
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<
5- What is the output for y? int y = 0; for (int i = 0; i< 10; ++i) { y +=i; } cout << y;

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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education