Punjab Technical University 2005 M.B.A Business Administration PROGRAMMING IN C/C++ (N2) MB 541 - Question Paper
Monday, 15 April 2013 05:25Web
PROGRAMMING IN C/C++ (N2) MB 541 3rd/4th Sem May 2k5
Max marks 60
Note: part A is compulsory. Attempt any 4 ques. from part B.
Section A Marks two every
1.
(a) What are Arrays?
(b) Name any 2 logical commands.
(c) What are pointers?
(d) What are Conditional Operators?
(e) What are the different library functions available for I/O?
(f) Find out error, if any in the subsequent C program:
{
Int code, flag;
if (code==1 & flag ==0)
printf (“/n The eagle has landed”);
}
(g) What do you mean by nested if statement?
(h) Convert the subsequent formula into a C statement.
R= [2v = 6.22(c +d)]/(g +v)
(i) Why is C called a high level language?
(j) Give different kinds of C constants.
part B Marks 10 every
2. 2 numbers re entered through the key board. Write a program to obtain the value of 1 number raised to the power of a different.
3. What will be the output of the subsequent program?
(a) main()
{
int I =0;
for (;i;)
printf (“\n Here is something for you”);
}
(b) main()
{
int i=45,c;
c= (i*1000);
printf (“\n %d ”,c);
}
check( int ch)
{
If (ch>= 400000)
return (ch/10);
else return (10);
}
4. Twenty 5 numbers are entered from the keyboard into an array. Write a program to obtain out how many of them are positive, how many are negative, how many are even and how many are odd.
5. Write a C++ program to compute the factorial value of any integer entered through the keyboard.
6. What is the difference ranging from C and C++ languages? discuss elaborate virtual functions?
7. Draw flow charts to obtain out prime numbers from 1 to fifty.
Earning: Approval pending. |