Assignment 3 (Due December 4)
Assignment 3 (Due December 4)
f x x f x
lim
x 0 x
Let f(x) be f ( x) 3x 4x3 9x2 8x 7
4
Find the derivative of f(x) for x=5 for different values of x decreasing up to
0. Your program should properly handle the division by zero.
6. Swapping two Numbers: Write a C++ program that swaps two numbers.
Your output may look like as follows:
Enter the value of numb1: 9
Enter the value of numb2: 5
Before Swapping:
Your entered value for numb1 = 9
Your entered value for numb2 = 5
After Swapping:
Value for numb1 = 5
Value for numb2 = 9
7. Area of Triangle using Heron’s formula: Write a C++ program that takes
finds the area of a triangle when three sides are given using Heron’s
formula.
Your program should ask repeatedly if the user wants to proceed further.
The program should be terminated when the user presses ‘n’ or ‘N’.
8. ASCII-Codes: All characters like small letters, capital letters, digits or
special character have ASCII codes when a key is pressed from keyboard
there is always an ASCII value behind it like if small letter 'a' is pressed its
ASCII is 97 if capital letter 'A' is pressed its ASCII value is 65 if a number
digit '0' is pressed its ASCII value is 48.
ASCII Value Ranges
For Digits 0-9 48-57
For Capital Letters A-Z 65-90
For Small Letters a-z 97-122
Special Characters 0-47, 58-64, 91-96, 123-127
On the basis of ASCII values and using operators like and operator (&&) or
Operator (||) we can differentiate the letters. Write a C++ program to check
whether the entered character is capital letter, small letter, digit or a special
character. Your program should ask the user if he wants to continue or not.
Your output may look like as follows:
Enter a character: A
The ASCII value of A is 65
You have entered a capital letter.
Do you want to continue? Y/N