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 4, Problem 26PS

Explanation of Solution

Given: The user passes 3, 5, 4, 6 as inputs in the following program:

#include

//Function Declarations

int strange(int x, int y);

int main(void)

{

//Local Declarations

int a;

int b;

int c;

int d;

int r;

int s;

int t;

int u;

int v;

//Statements

scanf("%d %d %d %d", &a, &b, &c, &d);

r=strange(a,b);

s=strange(r,c);

t=strange(strange(s,d), strange(4,2));

u=strange(t+3, s+2);

v=strange(strange(strange(u, a), b),c);

printf("%d %d %d %d %d", r, s, t, u, v);

return 0;

}//main

// = = = = = = = = = = strange = = = = = = = = = = =

int strange(int x, int y)

{

//Local Declarations

int t;

int z;

//Statements

t=x+y;

z=x*y;

return (t+z);

} //strange

To find: The output of the aforementioned program for the given inputs, 3, 5, 4, and 6.

Solution:

The aforementioned program will display the following output:

23 119 12599 1537565 184507919

The following are the descriptions for determining the output:

In the above program, firstly, the header file is included, and then the function, strange, is declared, which has two integer parameters...

Students have asked these similar questions
Considering the TM example of binary sum ( see attached)do the step-by-step of execution for the binary numbers 1101 and 11. Feel free to use the Formal Language Editor Tool to execute it; Write it down the current state of the tape (including the head position) and indicate the current state of the TM at each step.
I need help on inculding additonal code where I can can do the opposite code of MatLab, where the function of t that I enter becomes the result of F(t), in other words, turning the time-domain f(t) into the frequency-domain function F(s):
I need help with the TM computation step-by-step execution for the binary numbers 1101 and 11.  Formal Language Editor Tool can be used to execute it; Write it down the current state of the tape (including the head position) and indicate the current state of the TM at each step;

Chapter 4 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
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT