Computer Science MCQ Questions with Answer

MCQ Type questions for Competitive Exam.

1. For inputs A = 01010101 Find A XOR A?

a) 01010101 b) 00000000

c) 11111111 d)10101010

2. Which of the following technique is based on Decrease & Conquer?

a) Linear search b) Binary search

c) Bubble sort d) Merge sort

3. White box testing techniques use the concept?

a) Time complexity b) Space complexity

c) Usability complexity d) Cyclomatic Complexity

4. Black box testing is also called?

a) Structural testing b) code-based Testing

c) Clear-box testing d) Functional Testing

5. PDU Datagram/Segment is belonged to which layer of the OSI model?

a) Physical layer b) Transport Layer

c) Datalink Layer d) none of these

6. Which statement is False?

a) HTTP is State-full protocol

b) SMTP is stateless protocol

c) FTP is connection-oriented

d) DNS is connection-less

7. What is the output of the given program?

void check(int &arg)
{
       arg = 220;
 }

int main()
{
int arg1 = 20;
check(arg1);
cout<<"new value of arg is "<<arg1;
return 0;
}

a) 220 b)20 c)240 d) 22

8. What is the output?

#include <stdio.h>

void swap(int *a,int *b,int *temp)
{ 

    *temp=*a;
    *a=*b;
    *b=*temp;
    
    
}
int main()
{ int a=5,b=10,temp;
    swap(&a,&b,&temp);
    printf("\nThe values of variables after Swapping a=%d and b=%d",a,b);
}

a) The values of variables after Swapping a=10 and b=5 

b) The values of variables after Swapping a=5 and b=10

c) The values of variables after Swapping a=20 and b=5 

d) The values of variables after Swapping a=10 and b=15 

9. What is the output?

#include <stdio.h>
void winner()
{
    printf("u are winner");
}
 
 void Looser()
{
    printf("u are Looser");
}
void main()
{ 
   char Ticket_number='S';
   
    switch(Ticket_number)
    {
        case 'S':
        {
        winner();
        break;
        }
        
        case 'P':
        {
       Looser();
        break;
        }
        
        default:
        {
        printf("mixed");
        break;
        }
    }
    
  
 
}

a) u are Looser b) u are winner

c) Both a & b d) All of the above

10. 2’s complement of 10011010?

a) 01100110 b) 10011110

c) 10011010 d) 01101010

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top