PATTERN: Question Paper Consist of 4 parts. C---------20Questions C++ ----15Questions Unix-----15Questions Aptitude--15Questions
DURATION: 60 minutes.
SECTION 1: C
1. i=23, j=4, c=0; c=i++-++j;
What is the output of this program?
2. #define CUBE(x) x*x*x #define MUL3(x,y) 3*x*y #define ADD(x,y) x+y void main() { int j; int a; int b; j= CUBE(2+2); a=MUL3(4-3,5); b=ADD(16,1); } What will be the output?
3. Write A Program find and replace a character in a string.
4. Write A function to perform the substraction of two Strings. Eg:char N1="123",N2="478", N3=-355(N1-N2).
5. Write A Program to dynamically intialize a 2 dimentional array Eg:5x20,accept strings and check for vowels and display the no of vowels. Finally free the space allocated .
6. Write A Program to read a line from a file from location N1 to N2 using command line agruments Eg:exe 10 20 a.c
7. Write A Program to find the largest of 4 numbrers using macros.
10. double i=0.0; switch(i) { case 0.0: printf("jgdj"); case 1.0: printf("ptoy"); break; default: printf("hdfv");
What will be the output?
11. Write a function that will allow a floating point number to be raised to an integer power. In other words, we wish to evaluate the formula y=x power n;
12. Explain what happens when the following statement is executed? if(abs(x) < xmin) x=(x>0) ? xmin : -xmin;