Beruflich Dokumente
Kultur Dokumente
Q.1. State whether the following statements are true or false. [5]
Page 1 of 2
INSTITUTE OF PETROLEUM TECHNOLOGY, GANDHINAGAR
B.TECH - IN SEMESTER EXAM-1
COMPUTER PROGRAMMING (161)
Roll No. _____ Batch No. ____
#include <iostream.h>
void main( )
{
int k, num = 30;
k = (num > 5 ? (num <= 10 ? 100: 200) : 500 );
cout << k;
}
Q.6. Write whole C++ programs for the following USING FUNCTION(S)
only. (Any two out of three.) [5]
1. Accept kilobytes from the user and convert them into bytes, megabytes
and gigabytes.
2. To calculate the sum and average of any 5 values. (The input operation
should be performed in function called sumavg and the output should be
displayed in the main function.)
3. Nokia Co. has launched several mobiles in the market, generally
identified by the model number. Accept model number from the user
and display model name using following table.
Page 2 of 2