0% found this document useful (0 votes)
24 views1 page

In Lab Assignment 8: Course: Programming Fundamentals

The document outlines 6 programming questions as part of a lab assignment, including writing programs to input and output integer arrays, compute the sum of array elements, multiply the first and last elements of an array, search an array for a value, compare the sum of array elements excluding the largest value, and perform a union operation on two sets represented as arrays. The questions involve basic array operations like input, output, summation, multiplication, searching, and set operations.

Uploaded by

far_19954157
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

In Lab Assignment 8: Course: Programming Fundamentals

The document outlines 6 programming questions as part of a lab assignment, including writing programs to input and output integer arrays, compute the sum of array elements, multiply the first and last elements of an array, search an array for a value, compare the sum of array elements excluding the largest value, and perform a union operation on two sets represented as arrays. The questions involve basic array operations like input, output, summation, multiplication, searching, and set operations.

Uploaded by

far_19954157
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Course: Programming Fundamentals

In Lab Assignment 8
Date: 27th April, 2013 Lab Instructors: Hafsah Qaiser Rida Nayab, Sobia Bashir

Question 1: Write a program that inputs an integer array of size 10 from the user. And then output the contents of integer array. Question 2: Write a program that inputs an integer array of size 10 from the user and then computes and display the sum of all the elements of the array. Question 3: Write a program that inputs seven numbers from the user and multiplies only the first and last index element of the array and print its multiplication. For example: If the array contains 2,4,5,7,8,1,3 then the program will multiply first index value that is 2 and last index value that is 3 and print 2*3=6 Question 4: Write a program which inputs an array of size 5 and a value from a user. Then the program searches the value in the array and returns the count (number of times the specific element occurs in an array). Question 5: Write a program which inputs five numbers from the user. It finds the sum of all the elements of the array except the largest one and compare whether the sum of all other elements is greater than the maximum or not. Question 6: Given two sets A and B, the union operation gives a new set that contains the elements of both the sets, but no element can be repeated. So given that A={1,4,6,7,9} and B={7,9,10,15} then C=AUB (where U denotes the union operation)={1,4,6,7,910,15}. You have to write program using arrays to represent union of two sets. The size of array A and B must be taken as input from the user.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy