0% found this document useful (0 votes)
121 views3 pages

Object Oriented Programming Name: TE-53 Sec: Lab Task 1 Clo 1,2 Plo 1

This document contains questions about object oriented programming concepts in C++ such as functions, recursion, and data types. It asks the reader to write programs that use functions to calculate exponential series, determine primality, find greatest common divisors, produce multiplication tables, and reverse the case of characters. The questions cover function prototypes, definitions, calls, parameters, return statements, and recursion. It aims to help students practice and understand key object oriented programming topics.

Uploaded by

Muneeb Sami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views3 pages

Object Oriented Programming Name: TE-53 Sec: Lab Task 1 Clo 1,2 Plo 1

This document contains questions about object oriented programming concepts in C++ such as functions, recursion, and data types. It asks the reader to write programs that use functions to calculate exponential series, determine primality, find greatest common divisors, produce multiplication tables, and reverse the case of characters. The questions cover function prototypes, definitions, calls, parameters, return statements, and recursion. It aims to help students practice and understand key object oriented programming topics.

Uploaded by

Muneeb Sami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Object Oriented Programming

Name: TE-53 Sec

LAB TASK 1

CLO 1,2 PLO 1

Q1. Write a C++ program to evaluate the following series up to n where n is entered by the user

x x x
ex 1 ...
2! 3! n!

user will also enter the value of x

Q2. What is the purpose of

a) function prototype

b) function call

c) function definition

d) return statement

Q3(a). Write a function isPrime(int n) that takes an integer type input parameter n and calculates and
returns 1 if the n is prime otherwise returns 0

1
Object Oriented Programming
Name: TE-53 Sec

Q3(b). Enhance the above function to print out total number of prime numbers up to n. For example
the total numbers of primes up to 100 is 25.

Q4. What is the difference between function definition and function prototype

Q5. Write a program that takes 2 inputs and determines the gcd (greatest common divisor) of the
two numbers

2
Object Oriented Programming
Name: TE-53 Sec

Q6. Write a C++ program to produce an n times multiplication table, where n is entered by the user.
For example, if n=4 the table should look like this

1 2 3 4
1 1 2 3 4
2 2 4 6 8
3 3 6 9 12
4 4 8 12 16

Q7. Write a program that calls a function which reverses the case of the user defined character. The
program should prompt the user to enter a character and pass it as an argument to the case function.
The function after reversing its case should return the resulting character to the main . By using
comments please mention where is the function prototype, function definition, function call

You might also like