Friday, March 3, 2017

TEST-1 For 2nd CSE-1 RPRA Date : 04032017 Time 11.00 A.M.

Compiled By  : RVS@RISECSE

1)
main(){
printf("%d  %d   %d",sizeof(400L),sizeof(400)
,sizeof(400.0));
a)4 2 8     b)2  2 4      c)2 2 8     3)error

2)
char ch='xy';
val of ch is?
a)y         (b)x            c)none      d)NULL

3)
main()
{
int x;
x=10,20,30;
printf("%d",x);
}
a)30   b)20    c)10   d)error;
4)
main()
{
int a=117;
printf("%x",a);
}
a)75     b)117   c)error   d)0
5)
main(){
enum    bykes{suzuki,honda=3,hero};
printf("%d",suzuki+hero);
}
a)4       b)2       c)6     d)error
6)
Main()
{
int a=3,b=7,c;
c=a==b==1;
printf("%d",c);  
}
a)1           b)0        c)3      d)7
7)
#  define max (a,b)    a/b
Main() {
Printf(“\n%d”,max(10,3));
}
a)      3   b)3.333  c)3.333333  d)error


8) .what will be the output of the program?
#include<stdio.h>
int main()
{
    int k, num = 30;
    k = (num < 10) ? 100 : 200;
    printf("%d\n", num);
    return 0;
}
a)200    b)30    c)100     d)500

9).what are the invalid identifiers?
a.DOUBLE
b.Int
c.Float
d.all above


10) what will be the output of the program?
void  main()
{
int x;
x=015+0x71+5;
printf(“%d”,x);
}
a.13
b.131
c. compiler error
d.9

11). float f=10.3456F; int x=f;
 what was the value of x?
A.  10.3
B.  10
C.  10.345
D.  10.346

12)
int i=5;
int j;
j=++i + ++i + ++i;
printf("%d",j);
A.  21
B.  18
C.  24
D.  15

13).
int a=0,b=1;
if(a=0)
 { printf("\ntrue"); }
 else
 { printf("\nfalse"); }
A.  none
B.  true
C.  syntax error
D.  false
14)
printf(" %d %d %d",sizeof(3.14) , sizeof(3.14F), 
sizeof(3.14L));
A.  8 4 10
B.  4 4 4
C.  8 8 8
D.  4 4 10
9
15)which of the following are unary operators
 1. !     2. sizeof      3. ~        4. &&
A.  1,2
B.  1,3
C.  1,2,3
D.  2,4

16)char f=255; f++; printf("%d ",sizeof(f));
A.  2
B.  4
C.  compilation error
D.  1
17)
int a; a=sizeof(!5.6); printf("%d",a);
A.  2
B.  4
C.  10
D.  8
18)
void main()
{
            float x=10.2345F;
            int a;
            clrscr();
            a=x-(int)x;
            printf("\n%f",(float)a);
}
a)10.234500                b)0.000000                  c)error                         d)10.2345

19) 3.#include<stdio.h>
void main()
{
            int ch=NULL || EOF+1 && EOF ;
            clrscr();
            printf("%d",ch);
}
a)0       b)1       c)-1      d)48
20)
12. #include<stdio.h>
void main()
{
            int a=5^8;
            printf("%d",a*a);
}
a)13     b)169   c)-169  d)-13
21)
#include <stdio.h>
        int main()            {
                        if(1)
                        if(0);
                        else if(1)
                        printf("\nOver");
                        else;
        }
a)Over b)syntax missing error   c)nothing d)misplaced else

22)
1.#include<stdio.h>
int main(){
    int i,j;
    i=j=(2,3),0;
    while(--i&&j++)
         printf(" %d %d",i,j);
    return 0;
}
a)1 3     b)none  c)13  02  d)24 25

23)
. int main()
{
            int i=1,n;
            clrscr();
            for(i=0,n=0;i<=5;n+=i++);
            printf("%d",n);
}

a)25      b)21      c)garbage          d)15
24)
#include<stdio.h>
main()
{
  char not=!EOF;
  clrscr();
  printf("\n%d %d",EOF,not);
}
a. 0 0    b.error  c.-1 0   d.-1 1

25)
Int a=2;
a=a++ + ~++a;
a value is?
a)      0         b)1   c)-1   d)2

26)
 void main()
                {           while(1,2,'a',0)
                                {
                                                printf("abc");
                                }
                                printf(" def");
                }

a)abc def   b)error   c) def   d)abc abc abc def
27) void main()
{
int a=4,b=6;
if(++a==--b && 1)
printf("\ntrue");
else;
printf(" false");
}
a)true   b)false   c)true false  d)error
28)
main()
{
                printf(“RISE_ONGOLE”+4);
}
a)         RISE     b)RISE_    c)_ONGOLE   d) error

29)main()
{
enum {india,is=7,great};
printf(“%d%d”,india,great);
}
a)      7 1  b)7 8        c) 1  2    d)erro



30)  main() {
printf(“%d”,7>3>2?10:20<4?0:1);
a)      0    b) 1    c)  10      d) error
------------------------------------------------Good Luck-------------------------------------------------------

No comments:

Post a Comment