C Tech Questions (1)

Embed Size (px)

Citation preview

  • 8/4/2019 C Tech Questions (1)

    1/44

    C Programming1. main( )

    {

    int x = 10, y = 20;/.

    x =!x;y =!x&&!y;

    printf(x =%d y =%d, x, y);}

    a) x = 10 b) x = 0 c) x = 20 d) None

    y = 20 y = 0 y = 10

    2. main( ){

    int x = 5;

    x++;printf(x =%d\n, x);

    ++x;

    printf(x = %d\n, x);}

    a) x = 5 b) x = 6 c) x = 7 d) None

    x = 7 x = 7 x = 53. main( )

    {

    int x = 10, y =x, z =x;

    y = x;z = -x;

    t = - x;

    printf(y =%d z=%d t=%d, y, z, t);

    }a) y = -10 b) y = 0 c) y = 0 d) None

    z = 0 z = -10 z = -10t = -10 t = -10 t = -10

    4. main( )

    {int i;

    for(i = - 1; i < = 10 ; i + +)

    {if ( i < 5 )

    continue ;else

    break;

    printf(Gets printed only once!!);

    }}a) No output b) Gets printed only once c)Error d) None

  • 8/4/2019 C Tech Questions (1)

    2/44

    5. main( )

    {int i =135, a =135, k;

    k =function(!++i, !a++);

    printf(i =%d a=%d k=%d, i, a, k);}

    function(j, b)int j, b;{

    int c;

    c = j + b;

    return( c );}

    a) i = 136 b) i = 136 c) i = 135 d)None

    a = 135 a = 136 a = 136

    k = 0 k = 0 k = 0

    6. main( )

    {int k = 35, z;

    z = func(k);

    printf(z =%d, z);}

    func(m)

    int m;

    {+ +m;

    return(m = func1 (++m));}

    func1(m)

    int m;

    {m ++;

    return(m);

    }

    a) z = 38 b) z = 36 c) z = 37 d)None

    7. main( )

    {

    if(printf(C for yourself how it works\n))main( );

    }

  • 8/4/2019 C Tech Questions (1)

    3/44

    a)error b) C for yourself it works c) C for yourself how it worksd) None

    C for yourself how it works

    C for yourself how it worksC for yourself how it works

    .. . .. . .

    8. main( )

    {

    int i = 1;

    if(!i )printf(Recursive calls are real pain!);

    else

    {i = 0;

    printf(Recursive calls are challenging\n);

    main( );}

    } a)Recursive calls are challenging b) Recursive calls are challenging

    c) Error d) None

    Recursive calls are challengingRecursive calls are challenging .

    .. ..

    . 9. int i = 0;

    main( )

    {

    printf(in main i =%d\n, i);i ++;

    val( );printf(in main i =%d\n, i);

    }

    val( )

    {int i = 100;

    printf(in val i = %d\n, i);

    i ++;}

    a) 101 1 b) Error message c)1 100 d) None

    10. #define NO

    #define YES

    main( ){

    int i = 5, j;

  • 8/4/2019 C Tech Questions (1)

    4/44

  • 8/4/2019 C Tech Questions (1)

    5/44

    }

    a) 0 b) 1 c) e d) None

    15. main( ){

    static char str[ ] = { 48, 48, 48, 48, 48, 48, 48, 48, 48, 48};char *s;int i;

    s = str;

    for(i = 0; i

  • 8/4/2019 C Tech Questions (1)

    6/44

    {Nagpur, 1, a + 1},

    {Raipur, 2, a + 2},{Kanpur, 3, a}

    };

    struct s1*p = a;int j;

    for (j = 0; j data = 75;

    q->data = 90;

    p->previous = NULL;

    p->next = q;q->previous = p;

    q->next = NULL;

    while(p!=NULL)

    {

    printf(%d\n, p->data);

    p =p->next;}

    }

  • 8/4/2019 C Tech Questions (1)

    7/44

    a) 90 b) 75 c) 90 d) None75 90 90

    19. main( )

    {struct a{

    int i;

    int j;

    };struct b

    {

    char x;char y[3];

    };

    union c{

    struct a aa;

    struct b bb;

    };union c u;

    u.aa.i = 512;u.aa.j = 512;

    printf(%d%d, u.bb.x, u.bb.y[0]);

    printf(%d%d, u.bb.y[1], u.bb.y[2]);

    }

    a)2020 b) 0022 c) 0202 d) None

    20. main( )

    {int a = 3, b = 2, c =1, d;

    d = a| b & c;printf(d = %d\n, d);d = a| b & ~ c;

    printf(d =%d\n, d);

    }

    a) d = 2 b) d = 3 c) d = 1 d) None

    d = 2 d = 3 d = 1

  • 8/4/2019 C Tech Questions (1)

    8/44

    21. main( ){

    static char a[]=Bombay;

    char *b=Bombay;printf(%d %d,sizeof(a),sizeof(b));

    }a. 1 6 b. 1 1 c. 6 6 d. None

    22. main( )

    {

    int i=3;i=i++;

    printf(%d,i));

    }a. 3 b. 4 c. undefined d. Error

    23. What error would the following function give on compilation.

    f (int a,int b)

    {

    int a;a=20;

    return a;

    }a. Missing parantheses in return statement.

    b. The function should be defined as

    int f(int a,int b)

    c. Redeclaration of a.d. None of the above.

    24. main( )

    {

    int b;

    b=f(20);printf(%d,b);

    }

    int f(int a){

    a>20?return (10):return (20);}

    a. 20 b. 10 c. No output d. Error

    25. #define sqr(x) (x*x)

    main( )

  • 8/4/2019 C Tech Questions (1)

    9/44

    {

    int a,b=3;a=sqr(b+2);

    printf(%d,a);

    }a. 25 b. 11 c. Error d. Garbage value

    26 #define str(x) #x#define Xstr(x) str(x)

    #define oper multiply

    main( )

    {char *opername=Xstr(oper);

    printf(%s,opername);

    }a. oper b. multiply c. Error d. None

    27. main( ){

    printf(%c,7[sundaram]);

    }

    a. S b. m c. \0 d. Error

    28. main( )

    {int a[ ]={10,20,30,40,50};

    char *p;

    p=(char *)a;

    printf(%d,*((int *)p+4));}

    a. 50 b. 10 c. Error d. None

    29. main( )

    {

    printf(%c,abcdefgh[4]);}

    a. a b. e c. Error d. None

    30. main( )

    {printf(%d %d %d,sizeof(3),sizeof(3),sizeof(3));

    }

    a. 1 1 1 b. 2 2 2 c. 1 2 2d. 1 1 1

    Note: Assume size of int is 2 bytes.

    31. main( ){

    struct emp{

  • 8/4/2019 C Tech Questions (1)

    10/44

    char n[20];

    int age;}struct emp e1={david,23};

    struct emp e2=e1;

    if(e1= = e2) printf(structures are equal);}

    a. structures are equalb. No outputc. Error

    d. None

    32. main( ){

    char a[ ];

    a[0] = A;printf(%c, a[0]);

    }

    a) Compilation Errorb) No output

    c) A

    d) None

    33. main( )

    {

    char **p =Hello;printf(%s, **p);

    }

    a) Hello b) **p c) Error d) None

    34. main( )

    {int count, end=20;

    for (count=1; count

  • 8/4/2019 C Tech Questions (1)

    11/44

    printf(%d, count);

    }The output is

    a)No display b) Error c) 20 21 d) 21

    35. main( )

    {int a=5;do

    {

    printf(%d\n, a);

    a = -1;} while (a>0);

    }

    a) 0 b) -1 c) Error d) 5

    36. main( )

    {int x = 5;

    printf(%d %d, x++, ++x);

    return 0;}

    a) Error b) 6, 6 c) 5, 7 d) 7, 6

    37. main( )

    {

    int z = 4;

    printf( %d, printf( %d %d , z, z));}

    a) 4 4 3 b) 4 4 5 c) 4 4 4 d) Error

    38. int i = 0;

    main( ){

    printf(i = %d, i);

    i++;val( );

    printf(After i=%d, i);val( );

    }

    val( )

    {

    i =100;printf(vals i=%d\n, i);

    i++;

  • 8/4/2019 C Tech Questions (1)

    12/44

    }

    a) i =0 b) i=0 c) Error d) None of the above

    vals i=100 vals i =100

    i =1 i=101vals i =100 vals i =100

    39. main( ){

    printf( %d %c \n);

    printf( %d %c \n);

    return 0;}

    a) Error b) d c d c c) Compilation error d) Some garbage valuewill be the output

    40. main( )

    {int i;

    scanf( %d, &i);

    switch( i ){case 1 :

    printf( Do);

    case 2 :printf( Re );

    case default :

    printf( SACHIN );

    } }The output will be

    a) DO Re SACHIN b) SACHIN c) Do Re d) Error

    41. # define COND(a > = 65 & & a < = 90)

    main( )

    {char a = R;

    if (COND)

    printf( UPPER CASE);

    elseprintf( LOWER CASE);

    }

    a) LOWER CASE b) UPPER CASE c) ERROR-COMPILE d) RUN-TIME ERROR

    42. main( ){

    int a[ ] = { 10, 20, 30, 40, 50};

    int j;

  • 8/4/2019 C Tech Questions (1)

    13/44

    for (j = 0; j < 5; j++)

    {printf( \n %d, * a);

    a ++;

    }}

    a) 0..5 b) 0..4 c) Error d) None of the above

    43. main( )

    {

    int a[ ] = { 10, 20, 30, 40, 50}char *p;

    p = (char *) a;

    printf( %d, * ((int*) p+4)); }

    a) 50 b) 10 c) Error d) None

    44. main( ){

    int a[5] = {2, 4, 6, 8, 10);

    int i, b =5;for(i=0; i

  • 8/4/2019 C Tech Questions (1)

    14/44

  • 8/4/2019 C Tech Questions (1)

    15/44

    }

    5 5 5 5 5 (b) 5 4 3 2 1 (c ) 5 4 3 2 1 0 (d) None of the above

    1) what will be the result of executing following program

    main( )

    {

    char *x="New";char *y="Dictionary";

    char *t;

    void swap (char * , char *);swap (x,y);

    printf("(%s, %s)",x,y);

    char *t;t=x;

    x=y;

    y=t;printf("-(%s, %s)",x,y);

    }

    void swap (char *x,char *y){

    char *t;

    y=x;x=y;

    y=t;}

    a).(New,Dictionary)-(New,Dictionary)

    b).(Dictionary,New)-(New,Dictionary)

    c).(New,Dictionary)-(Dictionary,New)d).(Dictionary,New)-(Dictionary,New)

    2) What will be result of the following program

    main(){

    void f(int,int);

    int i=10;

    f(i,i++);}

    void f(int i,int j)

    {

  • 8/4/2019 C Tech Questions (1)

    16/44

    if(i>50)

    return;i+=j;

    f(i,j);

    printf("%d,",i);}

    a).85,53,32,21b)10,11,21,32,53

    c)21,32,53,85

    d)none of the above

    3)What is the size of 'q'in the following program?

    union{

    int x;char y;

    struct {

    char x;char y;

    int xy;}p;

    }q;

    a)11b)6

    c)4

    d)5

    4)Result of the following program is

    main(){

    int i=0;for(i=0;i

  • 8/4/2019 C Tech Questions (1)

    17/44

    5)What is the resultmain()

    {

    char c=-64;int i=-32

    unsigned int u =-16;if(c>i){printf("pass1,");

    if(c

  • 8/4/2019 C Tech Questions (1)

    18/44

    w

    8) What's wrong with the code "char c; while((c = getchar()) !=EOF) ..."?

    a) EOF cannot be used in while loop

    b) EOF cannot be used with getcharc) C should be an integer

    d) None of the above

    9) What is the O/P of the program given below

    main( )

    {

    static char a[]=Bombay;char *b=Bombay;

    printf(%d %d,sizeof(a),sizeof(b));

    }a. 1 6 b. 1 1 c. 6 6 d. None

    10 What is the O/P of the program given below

    main( )

    {int I=3;

    I=I+ +;

    printf(%d,I));}

    a. 3 b. 4 c. undefined d. Error

    11What error would the following function give on compilation.

    f (int a,int b){

    int a;

    a=20;

    return a;}

    a. Missing parantheses in return statement.

    b. The function should be defined asint f(int a,int b)

    c. Redeclaration of a.d. None of the above.

    2 )#define str(x) #x

    #define Xstr(x) str(x)

    #define oper multiplymain( )

    {

  • 8/4/2019 C Tech Questions (1)

    19/44

    char *opername=Xstr(oper);

    printf(%s,opername);}

    a. oper b. multiply c. Error d. None

    13)main( ){

    printf(%c,7[sundaram]);

    }

    a. S b. m c. \0 d. Error

    14)main( )

    {int a[ ]={10,20,30,40,50};

    char *p;

    p=(char *)a;printf(%d,*((int *)p+4));

    }

    a. 50 b. 10 c. Error d. None

    15)When a array int arr[MAXROW][MAXCOL] is passed to a function fun( ) then the

    function fun( ) will be defined asa. fun(int a[ ][MAXCOL])

    b. fun(int a[ ][MAXROW])

    c. fun(int (*ptr)[MAXCOL]))

    d. fun(int a[ ])

    16)main( )

    {

    printf(%c,abcdefgh[4]);

    }a. a b. e c. Error d. None

    17)main( )

    {printf(%d %d %d,sizeof(3),sizeof(3),sizeof(3));

    }

    a. 1 1 1 b. 2 2 2 c. 1 2 2d. 1 1 1

    18)main( )

    {

  • 8/4/2019 C Tech Questions (1)

    20/44

    struct emp{

    char n[20];int age;}

    struct emp e1={david,23};

    struct emp e2=e1;if(e1= = e2) printf(structures are equal);

    }a. structures are equalb. No output

    c. Error

    d. None

    19)main( )

    {FILE *fp;

    fp=fopen(x1,r);

    }fp points to

    a) The first character in the file

    b) A Structure which contains a char pointer which points to the first character inthe file.

    c) Name of the file

    d) None of the above

    20)If the following program (myprog) is run from the command line as

    myprog *.c

    What would be the output?main (int arg c, char *argv[ ])

    {int i;

    for (i=1; i

  • 8/4/2019 C Tech Questions (1)

    21/44

    22)If the following program (myprog) is run from the command line as

    myprog Friday Tuesday Sunday

    What would be the output?main(int argc, char *argv[])

    {printf(%C, (* ++ argv)[0];

    }

    a) m b) f c) myprog d) Friday

    23)main( )

    {

    int a;char *[ ]= Programming;

    for (a=0; x[a]! = \0; a++)

    if (( a%2 = =0) printf(% C, x[a]);}

    The output is

    a) Programming b) rgamng c) Pormig d) None

    24)float *(* x[20]) (int *a)

    a) x is array of pointer to functions accepting integer pointer as an argument andreturning a pointer to float.

    b) x is pointer to a function which accepts an array of pointers and returns a float

    c) x is a pointer to a function that accepts a pointer to an integer array and returns

    a characterd) None

    25)Declaration for a pointer to function pointer that accepts an argument which is an

    array of pointer 5 integers and returns a pointer to a character is

    a) char * (* ptr) (int * a[5])

    b) char (*x) (int (*a) [])c) char * (*x) (int a[5])

    d) char * (*x[5]) (int a[5])

    26) main( )

    {int count, end=20;for (count=1; count

  • 8/4/2019 C Tech Questions (1)

    22/44

    if(count %6) continue;

    elseif(count %8) continue;

    else

    if(count %10) continue;else

    if(count %12) continue;else

    printf(%d, count); }

    printf(%d, count);

    }

    The output isa)No display b) Error c) 20 21 d) 21

    27)

    main( )

    {int n[25];

    n[0] = 100;

    n[24] = 200;

    printf(\n%d%d, * n, *(n+24) + *(n+0));}

    a) 100 300 b) 100 200 c) Error d) 300, 100

    28)

    main( ){

    int i;

    scanf( %d, &i);switch( i ){

    case 1 :

    printf( Do);case 2 :

    printf( Re );

    case default :

    printf( SACHIN );} }

    The output will bea) DO Re SACHIN b) SACHIN c) Do Re d) Error

    29) . main( ){

    int b;

    b = f(20);

  • 8/4/2019 C Tech Questions (1)

    23/44

    printf( %d, b);

    }int f(int a)

    {

    a>20 ? return(10) : return(20);}

    a) 20 b) 10 c) No output d) Error

    30)

    main( ){

    int arr[ ] = { 0, 1, 2, 3, 4};

    int *ptr;for (ptr = &arr[0]; ptr

  • 8/4/2019 C Tech Questions (1)

    24/44

    2) #define NULL 0

    main( ){

    struct node{

    struct node *previous;int data;struct node *next;

    };

    struct node *p, *q;

    p = malloc(size of(struct node));

    q = malloc(size of (struct node));

    p->data = 75;

    q->data = 90;

    p->previous = NULL;

    p->next = q;

    q->previous = p;

    a->next = NULL;

    while(p!=NULL)

    {printf(%d\n, p->data);

    p =p->next;

    }

    } a) 90 b) 75 c) 90 d) None75 90 90

    3) main( )

    {

    struct a

    {int i;

    int j;

    };struct b

    {char x;char y[3];

    };

    union c

    {struct a aa;

    struct b bb;

  • 8/4/2019 C Tech Questions (1)

    25/44

    };

    union c u;

    u.aa.i = 512;

    u.aa.j = 512;

    printf(%d%d, u.bb.x, u.bb.y[0]);printf(%d%d, u.bb.y[1], u.bb.y[2]);

    }

    a)2020 b) 0022 c) 0202 d) None

    4)main( )

    {int a = 3, b = 2, c =1, d;

    d = a| b & c;

    printf(d = %d\n, d);d = a| b & ~ c;

    printf(d =%d\n, d);

    } a) d = 2 b) d = 3 c) d = 1 d) one

    d = 2 d = 3 d = 1

    5)

    What is the output?

    line 1 main ( )

    line 2 {

    line 3 char a{3}{3}=

    {{a,b,c},{p,q,r},{x,y,}}

    line 4 char**p;

    line 5 *p=a[0];

    line 6 printf(%s\n.*p);

    line 7 }

    a)Abc

    c)

    Abcpqrxy

    b)Compilation errord). None of the above

    6. What will be the output of this program?

    #include

  • 8/4/2019 C Tech Questions (1)

    26/44

    void main(void)

    {

    int varl=5,var2=5,var3=6,minmax;

    minmax=(var1>var2)?(var1>var3) ? varl:var3:(var2>var3)? var2:var3;

    printf(%d\n,minmax);

    }

    This program will

    a.Produce a runtime error

    c.Print 5

    b.Produce a compilation error

    d. Print 6

    7. What will be the output of the following program?main( )

    {int x = 1, y = 4, z = 4;printf("ans=%d", z >= y && y >= x ? 100:200);

    }

    a. 100 c. 200b. 100 200 d. None of the above

    8. To get the outputc=0 d=2

    What should be coded in the blank space?

    main( ){

    enum code

    {

    add,delete,

    modify,

    unchanged};

    ............................... ;

    CODE c,d;

    c = add;d = modify;

    printf("c=%d d=%d",c,d);

    }

    a. Typedef code CODE c. typedef enum code CODE

    b. Typedef enum code d. None of the above

  • 8/4/2019 C Tech Questions (1)

    27/44

    9#include"stdio.h"

    main( )

    {FILE *fp;

    Char str[80];

    /*TRIAL.C contains only one line:

    its a round,round,round world!*/

    fp=fopen(TRIAL.C","r");________________________ ;

    puts(str);

    }To get this output "its a round, round, round world!" in an infinite loop, what should

    be coded in the blank space.

    a. While(fgets(Str,80,fp)!=EOF) c. while(getch(fp)!=EOF

    b. While(fp!=NULL) d. None of the above

    10)What will be the output of the following program?

    #define ISLOWER(a) (a >= 97 && a

  • 8/4/2019 C Tech Questions (1)

    28/44

    a. 010110 b. 011100

    c. 101100

    d. None of the above

    13. If you are using open function for opening a file the file handle should be of____________ type.

    a) FILE

    b) int

    c) char d) None of the above

    14)main( ){

    static float a[ ] = { 13.24, 1.5}

    float *j, *k;j = a;

    k = a + 2;

    j = j * 2;

    k = k/2;printf(%f%f , *j, *k);

    }a) Error b) Some value c) No output d) None of the above

    15)main( )

    {static char s[ ] = Rendezvous;

    printf(%d, *(s+ strlen(s)));}

    a) 0 b) Rendezvous c) \0 d) Error

    16)# include stdio.h

    main( )

    {FILE *fp;

    char c;fp = fopen(TRY.C, ,r);if(fp = NULL)

    {

    puts(Cannot open file);

    exit(1)}

    while((c =getc(fp))! = EOF)

  • 8/4/2019 C Tech Questions (1)

    29/44

    putch(c );

    fclose(fp);}

    a) Error c) Each character read would be displayed on the screen

    b) No output

    17)main( ){

    char ch = `E`

    switch(ch)

    {case(ch > = 65 && ch < =90):

    printf(Capital Letter);

    break;case(ch >=97 && ch

  • 8/4/2019 C Tech Questions (1)

    30/44

    19)Consider the following C program.

    #include

    void main(void){

    unsigned int c;unsigned x=0x0003;scanf("%u",&c);

    switch(c&x)

    {

    case 3 : printf("Hello! \t");case 2 : printf("Welcome \t");

    case 1 : printf("To All \t");

    default: printf("\n");}

    }

    If the value input for the variable c is 10, what will be the output

    of the program ?

    a) The program will generate a compile time error as there is no breakstatement for the various case choices.

    b) The program will print Hello!

    c) The program will print Welcome To Alld) None of the above

    20)

    Study the following program#include

    void main(void);void main(void)

    {

    int var1=5,var2=5,var3=6,minmax;

    minmax = (var1 > var2) ? (var1 > var3) ? var1:var3:(var2 > var3) ? var2:var3;printf("%d\n",minmax);

    }

    This program willa) Produce a runtime error

    b) Produce a compilation errorc) Print 5d) Print 6

    21)

    Consider the following C program.#include

    void main(void)

  • 8/4/2019 C Tech Questions (1)

    31/44

    {

    unsigned int c;unsigned x=0x0003;

    scanf("%u",&c);

    switch(c&x){

    case 3 : printf("Hello! \t");case 2 : printf("Welcome \t");case 1 : printf("To All \t");

    default: printf("\n");

    }

    }

    If the value input for the variable c is 10, what will be the output

    of the program ?

    a) The program will generate a compile time error as there is no break

    statement for the various case choices.b) The program will print Hello!

    c) The program will print Welcome To All

    d) None of the above

    22. What will be the output of the following program?

    main( )

    {int i=3;

    switch (i)

    {

    case 1:printf("au revoir!);

    case 2:printf("adieu!");

    case 3:

    continue;

    default:printf("plain simple goodbye!");

    }

    }

    a. plain simple goodbye c. au revoir adieub. Error d. None of the above

    23. What will be the output of the following program?

  • 8/4/2019 C Tech Questions (1)

    32/44

    main( )

    {static float a [ ]={13.24,1.5,1.5,5.4,3.5};

    float *j, *k;

    j=a;k=a+4;

    j=j*2;k=k/2;printf("%f %f",*j,*k);

    }

    a. 13.24 1.5 c. Compilation error b. 15.5 5.4 d. Runtime error

    24. What is the output of the following code?main ( )

    {

    struct xyz{

    int I;

    int k;

    } pqr = {100,300};struct xyz *z;

    z=&pqr;

    z->I=300;z->k=100;

    abc(z)

    }

    abc(char *p)

    {p++;

    printf(%d\n,*p);

    }

    a. 5

    b. 1

    c. 2d. None of the above

    25. What will be the output of the code given below?main ( )

    {

    int c =0,d=5,e=10, a;

    a=c>1?d>1||e>1? 100:200:300;printf(a=%d,a);

    }

  • 8/4/2019 C Tech Questions (1)

    33/44

  • 8/4/2019 C Tech Questions (1)

    34/44

    28. What will be the output of the code given below?main ( )

    {

    static char *s [ ] ={ice,

    green,cone,please

    };

    static char **ptr[ ]={s+3,s+2,s+1,s};

    char ***p=ptr;printf(%s\n,**++p);

    printf(%s\n,*--*++p+3);

    printf(%s\n,*p[-2]+3);printf(%s\n,p[-1][-1]+1);

    }

    A cone

    ase

    reen

    B ase

    cone

    reen

    C reen

    ase

    cone

    D None

    29 What will be the result of the following program?

    main ( ){

    void f(int,int);

    int i=10;

    f(i,i++);}

    void f(int i, int j){

    if(i>50)

    return;

    i+=j;f(i,j);

    printf(%d,i);

    }

    a. 85,53,32,21 b. 10,11,21,32,53 c. 21,32,53,85 d. None

    30. What will be the output of the following code?

    main ( )

    {

    FILE*fp;fp=fopen(TRIAL.C,r);

    fclose(fp);

  • 8/4/2019 C Tech Questions (1)

    35/44

    }

    a. The file TRIAL.C if existing will be opened in read mode

    b. Error will be generated because c file cannot be opened through fopen

    c. Error will be generated because fclose( ) cannot be given with the file pointerd. None of the above

    31 What is the value of i after the following function is executed 17 timesvoid test ( )

    {

    static float i=0.0;

    i=7.5;i=+=7.5;

    }

    a. 7.5 c. 15.0

    b. 15+16*7.5 d. 0.0

    32. What is the value of m when the following program runs?

    void transform(register int*x)

    {

    x+=5*3;}

    void main ( )

    {register int m=3;

    transform(&m);

    }

    a. 18

    b. 24c. 3

    d. Erroneous program as a register variable has no address

    _______________________________________________________________________

    _

  • 8/4/2019 C Tech Questions (1)

    36/44

    FUNDAMENTALS OF COMPUTERS

    1. What was the name of the first commercially available Microprocessor chip?

    a. Intel 8008

    b. Intel 8080c. Intel 4004

    d. Motorola

    2. The parity bit is added for ______________ purpose

    a. Coding

    b. Indexingc. Error detection

    d. Controlling

    3. A logic gate is an electronic circuit which

    a. Makes logic decisionsb. Allows electron flow in only direction

    c. Works on binary algebra

    d. Alternates between 0 and 1

    4. The process of converting analog signal into digital signals so they can be

    processed by a receiving computer is referred to as

    a. Modulation

    b. Demodulation

    c. Synchronizing

    d. Desynchronozing

    5. A distributed data processing configuration in which all activities must passthrough a centrally located computer is called

    a. Ring Network

    b. Spider networkc. Hierarchical Network

    d. Data control Network

    6. Communication between computers is always

    a. Serialb. parallel

    c. series parallel

    d. direct

  • 8/4/2019 C Tech Questions (1)

    37/44

    7. Two basic types of Operating Systems are

    a. Sequential and direct

    b. Batch and timesharing

    c. Direct and interactived. Batch and interactive

    8. Multiprogramming was made possible by

    a. Input/Output units that operate independently of the CPU

    b. Operating Systems

    c. Both c and dd. Neither a and b

    9. What is the alternative name for application software

    a. Utility software

    b. Specific softwarec. End-user software

    d. Practical software

    10 Which of the following is not the characteristic of a relational database model

    a. Tables

    b. Treelike structurec. Complex logical relationship

    d. Records

    11. The language used in the application programs to request data from the DBMS isreferred to as the

    a. DML

    b. DDL

    c. Query language

    d. Any of the Above

    12. In data flow diagrams, an originator or receiver of data is usually designated by

    a. square box

    b. a circlec. a rectangled. an arrow

    13. A. Decision trees are easier for most people to understand than decision tables.

  • 8/4/2019 C Tech Questions (1)

    38/44

    B. Structured English is easier to convert to program code than regular narrative

    English.

    a. both A and b are true

    b. both A and B are falsec. Only A is true

    d. Only B is true

    14. Who invented the GOTO instruction that tells a computer to jump backwards or

    forwards in its program

    a. Charles Babbageb. Ada Augusta Byron

    c. JM Jackguard

    d. Grace Murray Hooper

    15. What is the name of the program coding that is unnecessarily complex and

    difficult to follow

    a. Pseudocode

    b. Spaghetti

    c. Complex Coded. Object Code

    16. What is the name of the programming technique, which emphasizes breakinglarge and complex tasks into successively smaller sections?

    a. Scrambling

    b. Structured Programmingc. Micro Programming

    d. Sub Programming

    17. Data integrity refers to

    a. Privacy of datab. The simplicity of data

    c. The validity of data

    d. The security of data

    18. Which data communication method is used for sending data in both directions atthe same time.

    a. Super duplex

    b. Simplex

    c. Half duplexd. Full duplex

  • 8/4/2019 C Tech Questions (1)

    39/44

    19. What is the usual number of bits transmitted simultaneously in parallel data

    transmission used by microcomputers?

    a. 6

    b. 9c. 8d. 7

    20. The transfer of data from a CPU to peripheral devices of a computer is achieved

    through

    a. modems

    b. computer portsc. interfaces

    d. buffer memory

    21. The channel in the data communication model can be

    a. postal mail services

    b. telephone linesc. radio signals

    d. all the above

    22. The systematic access of small computers in a distributed data processing system

    is referred to as

    a. dialed serviceb. multiplexing

    c. pollingd. conversational mode

    23. A characteristic of a multi programming system is

    a Simultaneous execution of Program instructions from two applications

    b. Concurrent processing of two or more programs

    c. Multiple CPUs\d. All the above

    24. In the IBM PC - AT, What do the words AT stand for

    a. Additional Terminal

    b. Advance Technologies

    c. Applied Technologiesd. Advanced terminology

  • 8/4/2019 C Tech Questions (1)

    40/44

    25. Different components on the motherboard of a PC processor unit are linked

    together by sets of parallel electrical conducting lines. What are these linescalled?

    a. Conductorsb. Buses

    c. Connectorsd. Connectivity

    26. Execution of instructions from different and independent programs by a computer

    at the same instant time is called

    a. Multiprogramming

    b. Multiprocessing

    c. Concurrent Programmingd. Multitasking

    27. Which of the following terms is the most closely related to main memory?

    a. nonvolatile

    b. permanent

    c. control unitd. temporary

    28. Which of the following are true?

    a. Fields are composed of bytes

    b. Fields are composed of characters

    c. Records are composed of fieldsd. All the above

    29 Which of the following hardware component is most volatile?

    a. ROM

    b. RAMc. PROM

    d. EEPROM

    30. Which of the following affects the processing power?

    a. Data bus capacityb. Addressing scheme

    c. Register size

    d. All the above

  • 8/4/2019 C Tech Questions (1)

    41/44

    31 An integrated circuit is

    a. a complicated circuit

    b. an integrating device

    c. much costlier than single transistord. fabricated in a single silicon chip

    32 Data processing is

    a. The same thing as data collection

    b. Similar to computer programming

    c. Mostly associated with commercial networkd. Akin to data coding

    33 A program written in machine language is called as ___________ program

    a. assembler

    b. objectc. computer

    d. machine

    34 A factor in the section of source language is

    a. programmer skill

    b. language availabilityc. program compatibility with other software

    d. all the above

    35. Which of the following is not transmission medium

    a. Telephone linesb. Coaxial cables

    c. Modem

    d. Microwave systems

    36. 10 GB HD space refers to

    a. 10 gigabytes of main memoryb. 10 gigabytes of section memory

    c. 10 gigabytes of Virtual memoryd. All the above

    37. A byte is

    a. 8 bits

    b. 4 bitsc. 16 bits

    d. 32 bits

  • 8/4/2019 C Tech Questions (1)

    42/44

    38. If you have a 64 kbps Internet line, it means that your maximum data transfer rate

    is

    a. 64 X 1000 bits per sec

    b. 64 X 1024 bits/secc. 64 X 1000 bytes/sec

    d. 64 X 1024 bytes/sec

    39. Unix is

    a. Multi-user OS

    b. Multi-user and Multitasking OSc. Multitasking OS

    d. Batch OS

    40. A stack is a

    a. FIFO listb. LIFO list

    c. Linear list

    d. Circular list

    41. A directory is organized as

    a. An inverted treeb. Is a one-d list of all files in the system

    c. Contain a list of all users of the system

    d. All the above

  • 8/4/2019 C Tech Questions (1)

    43/44

  • 8/4/2019 C Tech Questions (1)

    44/44

    e.