Computer Science MCQ Questions with Answer

MCQ Type questions for Competitive Exam.

Computer Science Engineering MCQ

1. What is the output of the C program?

#include <stdio.h>

int main()
{
    int arr[]={1,4,6,7,3,7}; 
    int *p;
    p=&arr[0];
 
    *p = *p+ * ++p;

    printf("Using  pointer : %d %d %d %d\n",*p++,*p++,*p++,*p);
                                            
    return 0;
}
 
  1.  Using  pointer: 6 6 5 5    
2. Using  pointer: 7 6 5 5       

3. Using  pointer: 7 6 6 5   

2. What is the output?

#include <stdio.h>


int swap(int a,int b)
{ 
    int temp;
    temp=a;
    a=b;
    b=temp;
printf("Before swapping the value of a =%d b=%d",a,b);
    
}
 
 int main()
{  int a=5, b=20;

    swap(a,b);
   

}

a) Before swapping the value of a =5 b=20 

b) Before swapping the value of a =20 b=5 

c) Before swapping the value of a =5 b=25  

3. What is the output of given Static program?

#include <stdio.h>

int store()
{
    static int i=0;
    
    return i++;
}
int main()
{ int i,m;
  // printf("The value of first time=%d",i);
   store();
  
    m=store();
   printf("\nThe value of first time=%d",m);
 

    return 0;
}

a) The value of first time=1      

b) The value of first time=0      

c) The value of first time=2     

4. What is the output of a given program?

#include <stdio.h>

int main()
{
    
    int x;
    
    x=printf("Class");
    
    printf("%d ",x);
   
   return 0;
  
}

a) Class   

b) Class 5  

c) 5 Class 

5. What is the output of a given program?

#include<stdio.h>

void disp()
{
    printf("Studies");
}

void main()
{
  
  disp();
  
  
}

a) Error

b) disp

c) Studies  

6. What is the output of a given program?

int sum(int,int);

void main()
{
 
  int a=1,b=20,c;
  
  c=sum(a,b);
  
  printf("result=%d",c);
  
}

int sum(int a, int b)
{
    int result;
    result=a+b;
    return result;
    
}

a) result=21

b) result

c) error

7. What is the output of a given program?

#include<stdio.h>

void disp(); 
void main()
{
  
  disp();
  
}

void disp()
{
    printf("ClassStudies");
}

a) Class

b) ClassStudies

c) Studies

8. What is the output of a given program?

#include<stdio.h>

void disp(); 
void main()
{
  
  disp();
  
}

void disp()
{
    char a = 'C';
    printf("%d", a);
}

a) C b) 66 c) 67 d) a

9. What is the output of a given program?


#include <stdio.h>
void Check(int *y, int *z)
{
    *z = *y;
    
}

void main()
{
    int a=10,b;
    Check(&a,&b);
    printf("B = %d",b);
}

a) Error

b) B = 10 

c) b

10. What is the output of a given program?

#include <stdio.h>

int sum(int a,int b)
{
    return a+b;
}
int main()
{
    int s=5;
   
    printf("SUM : %d",sum(5,7));
    return 0;
}

a) SUM : 12

b) Error

c) SUM : 5

Leave a Comment

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

Scroll to Top