.
  Vyom World.com . Let's Touch the Sky Together!  
.

Home
VyomWorld.com Home
Interview Questions
VyomLinks.com Home
JobsAssist.com Home
Vyom Network
Contact Us
Jobs & Careers
Resume Submitter
Placement Papers
IT Companies Directory
Computer Jobs
Interview Questions
Online Exams
Vyom Career eMag.
Fun
Send FREE SMS!
SMS Jokes
Source Codes Library
Source Codes Home
ASP Source Codes
C Source Codes
C++ Source Codes
COBOL Source Codes
Java Source Codes
Pascal Source Codes
Submit Source Codes
GATE
GATE an Overview
GATE Preparation
Study Materal
GRE
GRE an Overview
GRE Questions
GRE Preparation
GRE Universities
TOEFL Preparation
TOEFL Resources
GMAT Preparation
GMAT Resources
MBA Preparation
MBA Resources
Networking Concepts
Networking Concepts
Testing Preparation
Testing Resources
Webmasters
Free Traffic Builder
Webmaster Articles
Web Hosting
Tutorials
Hardware Tutorial
1500 Free eBooks New!


Home » Placement Papers » VIRTUSA Placement Papers » VIRTUSA Previous Year Placement Paper

 

VIRTUSA Placement Paper -: Technical Questions And Answers


Advertisements
Advertisements




VIRTUSA Previous Years Solved Sample Placement Papers

  1. What is the difference between the following declarations?

    const char *s;

    char const *s;

    Ans. No difference

  2. What would be the output of the following program?

    
    main() {
      char near * near *ptr1;
      char near * far *ptr2;
      char near * huge *ptr3;
      printf("%d %d %d", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3));
    }
        

    A. 1 1 1

    B. 1 2 4

    C. 2 4 4

    D. 4 4 4 Answer: Option D

  3. What error would the following function give on compilation?

    f(int a, int b)
    {
        int a;
        a=20;
        return a;
    }

    A. missing parenthesis in the return statement

    B. The function should be declared as int f(int a, int b)

    C. redeclaration of a Answer: Option C

    D. None of the above

  4. Solution: The variable a is redeclared within the same scope, which is not allowed.
  5. Point out the error in the following program:

    main()
    {
        const char *fun();
        *fun()='A';
    }
    const char *fun()
    {
        return "Hello";
    }

    Ans: fun() returns to a const char pointer which cannot be modified

  6. What would be the output of the following program?

    main()
    {
        const int x=5;
        int *ptrx;
        ptrx=&x;
        *ptrx=10;
        printf("%d",x);
    }

    A. 5

    B. 10

    C. Error

    D. Garbage value Answer: Option A

  7. Solution: Attempting to modify a constant variable through a pointer will not change its value in most compilers, but it is undefined behavior. The program prints the original value of x, which is 5.
  8. A switch statement cannot include:

    A. constants as arguments

    B. constant expression as arguments

    C. string as an argument Answer: Option C

    D. None of the above

  9. Solution: A switch statement only accepts constants or constant expressions as arguments; strings are not valid.
  10. How long will the following program run?

    main()
    {
        printf("\nSonata Software");
        main();
    }

    A. infinite loop

    B. until the stack overflows Answer: Option B

    C. All of the above

    D. None of the above

  11. Solution: The function calls itself recursively without any termination condition, leading to stack overflow eventually.
  12. On combining the following statements, you will get char *p; p=malloc(100);

    A. char *p= malloc(100)

    B. p= (char*)malloc(100)

    C. All of the above Answer: Option C

    D. None of the above

  13. Solution: Both forms are valid ways of allocating memory for a char pointer.
  14. What is the output of the following program?

    main()
    {
        int n=5;
        printf("\nn=%*d",n,n);
    }

    A. n=5

    B. n= 5 Answer: Option B

    C. n=5

    D. error

  15. Solution: The %*d format specifier dynamically sets the field width, which in this case is the value of n.
  16. In the following code, in which order the functions would be called?

    a = f1(23, 14) * f2(12 / 4) + f3();

    A. f1, f2, f3

    B. f3, f2, f1

    C. The order may vary from compiler to compiler Answer: Option C

    D. None of the above

  17. What would be the output of the following program?

    
    main() {
      int i = 4;
      switch (i) {
        default:
          printf("\n A mouse is an elephant built by the Japanese");
        case 1:
          printf(" Breeding rabbits is a hare raising experience");
          break;
        case 2:
          printf("\n Friction is a drag");
          break;
        case 3:
          printf("\n If practice makes perfect, then nobody's perfect");
      }
    }
        

    A. A mouse is an elephant built by the Japanese

    B. Breeding rabbits is a hare raising experience

    C. All of the above

    D. None of the above Answer: Option D

  18. What is the output of the following program?

    
    #define SQR(x) (x * x)
    main() {
      int a, b = 3;
      a = SQR(b + 2);
      printf("%d", a);
    }
        

    A. 25 Answer: Option A

    B. 11

    C. error

    D. garbage value

  19. In which line of the following, an error would be reported?

    
    #define CIRCUM(R) (3.14 * R * R)
    main() {
      float r = 1.0, c;
      c = CIRCUM(r);
      printf("\n%f", c);
      if (CIRCUM(r) == 6.28)
        printf("\nGobbledygook");
    }
        

    A. line 1

    B. line 5

    C. line 6

    D. line 7 Answer: Option D

  20. What is the type of the variable b in the following declaration?

    
    #define FLOATPTR float *
    FLOATPTR a, b;
        

    A. float

    B. float pointer Answer: Option B

    C. int

    D. int pointer

  21. In the following code:

    
    #include 
    main() {
      FILE *fp;
      fp = fopen("trial", "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 in the file. Answer: Option B

    C. The name of the file.

    D. None of the above.

  22. We should not read after a write to a file without an intervening call to fflush(), fseek(), or rewind(). TRUE/FALSE

    Ans. True

  23. If the program (myprog) is run from the command line as myprog 1 2 3, What would be the output?

    
    main(int argc, char *argv[]) {
      int i;
      for (i = 0; i < argc; i++)
        printf("%s", argv[i]);
    }
        

    A. 1 2 3

    B. C:\\MYPROG.EXE 1 2 3 Answer: Option B

    C. MYP

    D. None of the above

  24. In how many different ways can the letters of the word 'DETAIL' be arranged in such a way that the vowels occupy only the odd positions?

    A. 32

    B. 48

    C. 36 Ans: C

    D. 60

    E. 120

  25. What is the ratio of the peak ripple voltage level to its rms voltage level?

    v3 Ans: A

    v2

    v3/2

    v2/2

  26. In an improved shunt regulator, which of the following components sets the reference voltage?

    A. Transistor Q1

    B. Zener diode Ans: B

    C. Transistor Q2

    D. RS




 


.

Recently Updated: New Placement Papers added.
Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Programming & Source Codes | GRE Preparation | Jobs, Discussions | Software Listing | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | International Business Information | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | FAQs | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Excellent Mobiles | Software Testing | Interview Questions | Freshers Jobs | Server Insiders | File Extension Directory

Copyright ©2003-2025 Vyom Technosoft Pvt. Ltd., All Rights Reserved. Read our Privacy Policy