Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Function Prototypes - Quiz 2 | Advanced Programming 2011 | CS 2213, Quizzes of Computer Science

Material Type: Quiz; Professor: Korkmaz; Class: Advanced Programming; Subject: Computer Science; University: University of Texas - San Antonio; Term: Fall 2011;

Typology: Quizzes

2010/2011

Uploaded on 09/12/2011

thenadz
thenadz 🇺🇸

4.5

(51)

45 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf2

Partial preview of the text

Download Function Prototypes - Quiz 2 | Advanced Programming 2011 | CS 2213 and more Quizzes Computer Science in PDF only on Docsity!

2pt Sep (1, Lot! CS2213 Advanced Programming 1. (pt) It is claimed that x m n m+n too. A Jir—-—k r The following C program checks if this claim is true or not for the given values of m, r, and n. To complete the program below, you are asked to (i) implement two missing functions in the next page, and (ii) determine the suitable parameters when calling them in main{) . /* suppose we include the standard and textbook libraries here, and give the user defined function prototypes here */ void main() { int m, r, n, lhs, rhs; printf (*Get valid values for m ron: “); get_valid data (.. /* Pass parameters */ lhs = compute_LHS ( .); /* Pass parameters */ rhs if (lhs == rhs ) select( m+n, fr); printf ("Yes, the claim is true\n"); else print£(“No, the claim is false\n”) } NOTE: You can assume that int fact (int x) ; which computes factorial of x and x int select (int x, int y); which computes (7) “x-choose-y” are already implemented here. So you don’t need to implement them. If needed, you can use them.