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...

Blurred answer
Students have asked these similar questions
using r language to answer question 4.  Question 4: Obtain a 95% standard normal bootstrap confidence interval, a 95% basic bootstrap confidence interval, and a percentile confidence interval for the ρb12 in Question 3.
using r language
using r language

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