(15 Points)What is the output of the following program. Trace and display output int search(int,struet studinfo allstil.

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

(15 Points)What is the output of the following program. Trace and display output int search(int,struet studinfo allstil.

Post by answerhappygod »

15 Points What Is The Output Of The Following Program Trace And Display Output Int Search Int Struet Studinfo Allstil 1
15 Points What Is The Output Of The Following Program Trace And Display Output Int Search Int Struet Studinfo Allstil 1 (27.67 KiB) Viewed 45 times
(15 Points)What is the output of the following program. Trace and display output int search(int,struet studinfo allstil.int.in);// prototype struct studinfo Int stNr : char name|15|: int grade; int main() // Initialized sorted base on student number struct studInfo allSt[10] (434, "BEKIR" 75. 678,"CEMAL".65. 712." AHMET".48 841,"EMRAH 67, 855,"SEVGI" 78. 891."CANAN".88. 912."MERT",48 941,"SEMRA".94. 965,"GULER",38, 977,"MEHDI.83) int kent-10. given = 941: k=search (given, allst, 0, ent): if (>printf("Find Position -%d %%d\n", k. allStk.name, allStikerade) else printf("%s Not Found". given) return 0; }/"Main ends/ int search(int given, struct studinfo allSt[], int low, int high) ! int mid: while(low <=high) mid - (low + high) / 2: if (given--allSt[mid.stNr) return mid; else if (given > allstmid.stNr) printf("Low=%d Mid="%d\n", low, mid); low-mid+1; 1 else { printf("High=%d Mid=%d\n", high, mid); high-mid - 1; ) return -1; 2 OUTPUT OF THE PROGRAM
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply