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

Week # 4 (Pointers) : Task1

This document outlines 5 tasks involving pointers in C++. Task 1 has the user write a program to calculate a number's factorial by passing its address to a function. Task 2 has the user declare and initialize two arrays, then generate their sum using pointers. Task 3 calculates a circle's area using a constant PI value and constant pointer. Task 4 generates a times table using pointers. Task 5 designs a simple calculator program using pointers.

Uploaded by

ayaan khan
Copyright
© © All Rights Reserved
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)
54 views3 pages

Week # 4 (Pointers) : Task1

This document outlines 5 tasks involving pointers in C++. Task 1 has the user write a program to calculate a number's factorial by passing its address to a function. Task 2 has the user declare and initialize two arrays, then generate their sum using pointers. Task 3 calculates a circle's area using a constant PI value and constant pointer. Task 4 generates a times table using pointers. Task 5 designs a simple calculator program using pointers.

Uploaded by

ayaan khan
Copyright
© © All Rights Reserved
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/ 3

Week # 4 (Pointers)

Task1:
Write a program in C++ that can calculate the factorial of a number by passing the address of that
number to a function, using pointers.
Input:

Output:
Task2:
Write down a C++ program that will declare and initialize two arrays and would generate the sum of
these two arrays by using pointers.
Input:

Output:
Task3:
Write down a C++ program, that will Calculate the area of a Circle by using Constant Data member
PI=3.14, and by using Constant Pointer.
Input:

Output:

Task4:
Write down a C++ program that would generate some table 2*1=2,2*10=20by using pointers .
Input:

Output:
Task5:
Write down a C++ program that would design a simple Calculator, by using Pointers.
Input:
Output:

You might also like