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-------------------------------------------------------

Wednesday, March 1, 2017

Practice Papes for 2nd/3rd CSE-1/II RPRA/RGAN

1#include<stdio.h>
void main()
{
            clrscr();
            if((2==2) && printf("0") || 0)
            printf("true");
            else
            printf("false");
}
a)true  b)0true            c)false d)0
----------------------------------------------------------
2.#include<stdio.h>
void main()
{
            int ch='\0';
            clrscr();
            ch++;
            while(1 && ch)
            printf("%d",ch--);
}
a)NULL            b)0       c)1       d)infinate loop
----------------------------------------------------------
3.#include<stdio.h>
void main()
{
            int ch=NULL || EOF+1 && EOF ;
            clrscr();
            printf("%d",ch);
}
a)0       b)1       c)-1      d)48
----------------------------------------------------------
4.#include<stdio.h>
void main()
{                       printf("a\/b=c",'%d',"%d");
}
a)a=c   b)a\/b=c          c)a/b=c                        d)error
----------------------------------------------------------
5.#include<stdio.h>
void main()
{           clrscr();
printf("%d",1||-?('\n'==10!=0):printf("ok"));
}
a)1       b)0       c)error d)ok
6.#include<stdio.h>
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
7.#include<stdio.h>
void main()
{
            clrscr();
            printf("a%cb",'\\b');
}
a)a\b               b)a\\b              c)b       d)error
8.#include<stdio.h>
void main()
{
            float f=2.0;
            clrscr();
            printf("%d\t\t%d",a,sizeof(2.0f+2));

}
a)4       b)8       c)6       d)error

----------------------------------------------------------
9. #include<stdio.h>
void main()
{
            char ch='ab';
clrscr();
            do
            {
                        printf("%c",ch++);
            }while(ch!='c'+1);}
a)abc   b)ab     b)abcd             d)error
10. #include<stdio.h>
void main()
{
            int i,no=0;
clrscr();
            for(i=0;i<=5;no+=i++,i==5?printf("%d",no):0);
}
a)15     b)10     c)100   d)150
11. #include<stdio.h>
void main()
{char ch='0a';
                switch(ch)
                {
                case '0a':
                                puts("\nfirst");  break;
                                case 48:
                                puts("\nsecond");break;
                                default:                printf("wrong");
                }
}
a)first  b)wrong     c)error      d)second
12. #include<stdio.h>
void main()
{
            int a=5^8;
            printf("%d",a*a);
}
a)13     b)169   c)-169  d)-13
13.        #include <stdio.h>
        int main()
        {            int i = 0, j = 0;
            while (i < 5, j < 10)
            {
                i++;        j++;
            }
            printf("%d, %d\n", i, j);
        }
a)0,0    b)5,5    c)10,10    d)error
14. #include <stdio.h>
        int main()
            {           int a=7,b=2;
printf("\n%d",(int)((float)a/b-(int)a/b));
        }
a)0.5    b)0       c)0.500000      d)error
15. #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

16. #include <stdio.h>
        int main()
            {
            int i=10,j=9;
            clrscr();
                        while(--i && j++);
                        printf("\n%d %d",i,j);
        }
a)1   19            b)0   18           c)1  10 d)1  19
17. #include <stdio.h>
        int main()
            {
            int a = 6;
            int b = 12;
            clrscr();
            while(a<b){
            printf("\n%d %d",a,b,a+=2,b-=2);
            }
        }
How many loops took in the above program
a)1   b)2    c)3    d)0
18. #include <stdio.h>
        int main()
            {           do
                        {
                        printf("a");
                                    do
                                    printf("\b");
                                    while(0);
                        printf("c");
                        }while('\0');
        }
a)a\bc    b)c     c)a\b   d)error


19.write a program to print
54321012345 (use only one for)

20.  print
            0
            1 0
            0 1 0
            1 0 1 0
            0 1 0 1 0


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