An Introduction To Programming Through C++
IIT Bombay.
ASSIGNMENT 0:
1.What is the greatest common divisor (also called the highest common factor) of 147 and 84?
Ans: 21
I bought 5kg of cauliflower at Rs 50/kg, 3 kg of cabbage at Rs 40/kg, 3kg of capsicum at Rs 60/kg, and 2 kg of peas at Rs 70/kg.
2.What is the total cost in Rupees?
Ans: 690
3.How many multiplications did you need to perform for calculating the total cost ?
Ans: 4
4.How many additions did you need to perform for calculating the total cost?
Ans: 3
5.How many additions would you need to perform for calculating the total cost if I had bought n items? Give your answer in terms of n, as an expression in n. Do not put any spaces in your answer.
Ans: n-1
-----------------------------------------------------------------------------------
Next three questions (Q6, Q7 and Q8) are with reference to following description:
Given below is the seating plan for students in a certain class room.
Column 1 Column 2 Column 3
Row 1 Asha Remo Mehdi
Row 2 Bhimsen Talat Subbalaxmi
Just to clarify the meaning of the table above using examples: Bhimsen sits in Row 2, Column 1, while Mehdi sits in Row 1, Column 3.
Let Name [ i ] [ j ] = name of person sitting in row i and column j. Thus Name [ 2 ] [ 1 ] = Bhimsen, and Name [ 1 ] [ 3 ] = Mehdi.
6.What is Name [2][3]?
Ans: Subbalaxmi
7.Suppose i, j are such that Name[i][j] = Remo. What is the value of i?
Ans: 1
8.What is the value of j?
Ans: 2
-----------------------------------------------------------------------------------
Next three questions (Q9, Q10 and Q11) are with reference to following description:
The corners of a rectangle in the x-y plane have coordinates (10,40), (10,70), (30,40), (30,70)
9.What is the area of the rectangle?
Ans: 600
10.Is the point (20,80) inside the rectangle?
Ans: No
11.If a point strictly inside the rectangle has coordinates (p,q), then which of the following is correct?
Ans: q > 40
12.What is the slope of the tangent to the curve y=x^2 at the point (2,4)?
Ans: 4
-----------------------------------------------------------------------------------
Next three questions (Q13, Q14 and Q15) are with reference to following description:
Suppose x,y,z,w,u are numbers. Suppose we are given that x > y, y> z, z > w, y > u.
You should determine how consistent the statements given below are with
the facts you know about the numbers. You can classify each statement as one of:
*Always true
*Can be true
*Cannot be true
13.x is the largest.
Ans: Always true
14.u is the smallest
Ans: Always true
15.y is the median
Ans: Cannot be true
16.One thousand numbers are written on a large piece of paper. What method will you adopt to determine the largest one?
Ans: Just remember the largest number as you scan the numbers starting from the first to the last.
17.Given a positive integer p > 1, however large, which one is a fool proof way of finding out if p is a prime?
Ans: If p is not divisible by any number from 2 to another number q such that the square of q is > p, then p is a prime.
Disclaimer: Here you can find all nptel assignment solutions related to CS stream.These may help you for your assignment.The answers are only for verification.You cannot copy these directly from the post(code of conduct of NPTEL).These is not 100% correct solutions.
No comments:
Post a Comment
If you have any problems related to solutions or any concept please let me know.