Wednesday, March 1, 2017

Practice Paper for 2nd CSE-1 RPRA


1.Which of the following is not a valid variable name declaration?
a) int __a3;
b) int __3a;
c) int __A3;
d) None of the mentioned  
2. C99 standard guarantess uniqueness of _____ characters for external names.
a) 31
b) 6
c) 12
d) 14
3What is the output of this C code?
·             #include  <stdio.h>
·             int main()
·             {
·                char chr;
·                chr = 128;
·                printf("%d\n", chr);
·                return 0;
·             }
a) 128
b) -128
c) Depends on the compiler
d) None of the mentioned
Answer:b
Explanation:signed char will be a negative number.

4.            #include <stdio.h>
    int main()
    {
        enum {ORANGE = 5, MANGO, BANANA = 4, PEACH};
        printf("PEACH = %d\n", PEACH);
    }
a) PEACH = 3
b) PEACH = 4
c) PEACH = 5
d) PEACH = 6
5.    # define   X(a,b,c)  a>b&&a>c?a:b>c?b:c;   this macro  is used to perform  _____________________
6. char ch=’97’   the value of  ch is   ______________
7.    #include <stdio.h>
    int main()
    {
        int i = 3;
        int l = i / -2;
        int k = i % -2;
        printf("%d %d\n", l, k);
        return 0;
    }
-1 , 1
8. Evaluate         int x = 5 * 9 / 3 + 9;
                24
·          Evaluate     4*8/2+3*2/2                    
(19)
10.  int n1=10; 
     Int n2=n1+++++n1+--n1;
What is the value of n2?                ________________________
11.   #include <stdio.h>
    void main()
    {
        int x = 1, y = 0, z = 5;
        int a = x && y || z++;
        printf("%d", z);
    }
What it produces out put6
12. ·          int x = 1, y = 0, z = 3;
·          x > y ? printf("%d", z) : return z;
     What is the out put ________________
13.    #include <stdio.h>
    int main()
    {
        int i = 0, j = 0;
        if (i && (j = i + 10))
            //do something
            ;
    }
0
14.
int i = 0, j = 0;
if (i && (j = i + 10))
//do something
;
The value of j is 0
15.
int a = 1, b = 1, d = 1;
printf("%d, %d, %d", ++a + ++a+a++, a++ + ++b, ++d + d++ + a++);
o/p is 15,4,5
16. int a = !0;
     printf("\n.....%d",a);
ans : 1
 
 
 






No comments:

Post a Comment