PDF Archive

Easily share your PDF documents with your contacts, on the Web and Social Networks.

Share a file Manage my documents Convert Recover PDF Search Help Contact



SP13 Lab 6 Quizzes.pdf


Preview of PDF document sp13-lab-6-quizzes.pdf

Page 1 2 3 4 5 6

Text preview


Ain Shams University
Faculty of Computer & Information Sciences
Structured Programming
Lab Exam
First year

Section 15

Write a program that reads from the user numbers stored in two 1-D arrays, and then the program
should combine and sort the two arrays in a new array and then display it
Sample execution:
First array: 44,20,6,58,3,4,82,9
Second array: 45,3,56,7,98,2,3
New sorted array: 2,3,3,3,4,6,7,9,20,44,45,56,58,82,98

Ain Shams University
Faculty of Computer & Information Sciences
Structured Programming
Lab Exam
First year

Section 16

Write a program that takes the size of an array from the user, reads its elements, then asks the user to
enter two numbers (supposed to be found in the array) and finally calculates and displays the sum of
the numbers between the two numbers – excluding the two numbers themselvesSample execution:
Enter the size of the array: 8
Enter the numbers: 4,7,-3,7,1,-6,3,8
Enter two numbers from the array: 7, 3
Sum of the numbers between 7,3 is: -1

Ain Shams University
Faculty of Computer & Information Sciences
Structured Programming
Lab Exam
First year

Section 17

Write a program that takes two positive integer numbers and calculates the greatest common divisor of
those two integers.
Example:
Greatest common divisor of 40, 50 is 10
Greatest common divisor of 256, 625 is 1
Greatest common divisor of 42, 6 is 6