Vector india entrance Examnation 2021 solution

29 Dec 2022 Balmiki Mandal 0 C Programming

Vector India Entrance Examination 2021: C- Programming

Q. Output of the following program?

#include<stdio,h>
int main()
{
    int a=-3;
    a=a+a+!-3;
    printf("%d",a);
}
  • -5
  • -2
  •  0
  • -6

Ans-> -6 

 

Q. Output of the following program?

#include
int main()
{
    int a=5,b=6,c;
    c=(b++==6)||(--a<2);
    printf("%d%d%d",a,b,c);
}
  • 771
  • 471
  • 557
  • 571

Ans->571

 

Q. Output of the following program?

int main()
{
int i=10;
i=!i>14;
printf("%d\n",i);
}
  • 10
  • 0
  • 14
  • 1

Ans-> 0

 

Q. Output of the following program?

int main()
{
    unsigned int i=-2;
    if(i<0)
    printf("if block execuated");
    else 
    printf("else block execuated");
}
  • if block execuated 
  • else block execuated
  • both if and else 
  • none

Ans-> else Block excuated 

 

Q. Output of the following program?

#include
int main()
{
    int  a=123,b=456;
    a ^= b ^=a ^=b;
    printf("%d\t%d",a,b);
}
  • 456 120
  • 123 456
  • 456 123
  • 556 123

Ans-> 456 123

 

Q. Output of the following program?

#include
int main()
{
    int  a=123.4,b=456.8;
    a ^= b ^=a ^=b;
    printf("%d\t%d",a,b);
}
  • 456 120
  • 123 456
  • 456 123
  • 556 123

Ans-> 456 123

 

Q. Output of the following program?

#include
int main()
{
    int i;
    for(i=5;++i;i-=3)
    printf("%d",i);
}
  • 642
  • 542
  • 442
  • 641

Ans-> 642

 

Q. Output of the following program?

int main()
{
int y[4]={6,7,8,9};
int *ptr=y+2;
printf("%d\n",ptr[-1]);
}
  • -6
  • 6
  • -7
  • 7
Ans->

 

Q. Output of the following program?

int main()
{
    int a[]={11,22,33};
    int *ptr=a;
    printf("%d",a[0]++);
    printf("%d",a[0]++);
}
  • 11 12
  • 22 23
  • 11 11
  • 22 33

Ans-> 11 12

 

Q. Output of the following program?

int main(){
int a[]={10,20,30,40};
int i=3,x;
x=1*a[--i]+2*a[--i]+3*a[--i];
printf("%d\n",x);
}
  • 100
  • 30
  • 40
  • 10

Ans-> 100 

 

Q. Output of the following program?

int main()
{
    int x;
    x=3;
    f(x);
    printf("main");
}
f(int n)
{
    printf("f");
    if(n!=0)
    f(n-1);
}
  • ffff
  • ffffmain
  • mainffff
  • main

Ans-> ffffmain

 

Q. register varaiable are Treated as Static variable if CPU register are not present?

  • TRUE
  • FALSE

Ans-> FALSE

 

Q. Increase the size of a Dynamically memory allocation are ?

  • malloc
  • calloc
  • realloc
  • freealloc

Ans-> Freealloc

 

Additional Resources


[ vector india entrance exam solution 2021: C-programming ]

[ vector india entrance exam solution 2021: Digital electronic ]

[ vector india  entrance exam solution 2021:Micro Processor (8085/8086) ]

[ Vector India Sample paper entrance exam solution ]

 

Further Reading:

 For further information and examples, Please visit[ C-Programming From Scratch to Advanced 2023-2024]

 

Top Resources


 

 

 

Note: If you encounter any issues or specific errors when running this program, please let me know and I'll be happy to help debug them!

 

BY: Balmiki Mandal

Related Blogs

Post Comments.

Login to Post a Comment

No comments yet, Be the first to comment.