Вы находитесь на странице: 1из 8

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.

com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

TITLE: NIIT Sample Programming Placement Paper Level-1 (Bolded option is your answer) 1. Declare the following statement? "An array of three pointers to chars". A char *ptr[3](); B char *ptr[3]; C char (*ptr[3])(); D char **ptr[3];

2. What do the following declaration signify? int *ptr[30]; A ptr is a pointer B ptr is a array C ptr is a array to an array of 30 of 30 pointers of 30 integer integer pointers. to integers. pointers. 3. What will be the output of the program? #include<stdio.h> int main() { const int x=5; const int *ptrx; ptrx = &x; *ptrx = 10; printf("%d\n", x); return 0; } A5 B 10 D ptr is a array 30 pointers.

C Error

D Garbage value

4. What will be the output of the program?


Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

#include<stdio.h> int main() { int y=128; const int x=y; printf("%d\n", x); return 0; } A 128 B Garbage value C Error

D0

5. The maximum combined length of the command-line arguments including the spaces between adjacent arguments is A 128 characters B 256 characters C 67 characters D It may vary from one operating system to another

6. How will you print \n on the screen? A printf("\n"); B echo "\\n"; C printf('\n'); D printf("\\n");

7. If the two strings are identical, then strcmp() function returns A -1 B0 C1 D yes

8. In which stage the following code #include<stdio.h> gets replaced by the contents of the file stdio.h
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

A During editing B During linking

C During execution

D During preprocessing

9. Which of the following is the correct order of evaluation for the below expression? z=x+y*z/4%2-1 A */%+-= B=*/%+C/*%-+= D*%/-+= 10. Which of the following is the correct usage of conditional operators used in C? A a>b ? c=30 : c=40; B a>b ? c=30; C max = a>b ? a>c?a:c:b>c?b:c D return (a>b)?(a:b)

11. In the following code, the P2 is Integer Pointer or Integer? typedef int *ptr; ptr p1, p2; A Integer B Integer C Error in D None of above pointer declaration 12. In the following code what is 'P'? typedef char *charp; const charp P; A P is a constant B P is a C P is character D None of above character type constant 13. In a file contains the line "I am a boy\r\n" then on reading this line into the array str using fgets(). What will str contain? A "I am a boy\r\n\0" B "I am a boy\r\0" C "I am a boy\n\0" D "I am a boy"

14. Which of the following operations can be performed on the file "NOTES.TXT" using the below code?
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

FILE *fp; fp = fopen("NOTES.TXT", "r+"); A Reading B Writing C Appending D Read and Write

15. What does the following declaration mean? int (*ptr)[10]; A ptr is array of pointers to 10 integers B ptr is a C ptr is an array D ptr is an pointer to an of 10 integers pointer to array array of 10 integers 16. In C, if you pass an array as an argument to a function, what actually gets passed? A Value of B First element C Base address D Address of the elements in of the array of the array last element of array array 17. In mathematics and computer programming, which is the correct order of mathematical operators ? A Addition, B Division, C Multiplication, D Addition, Subtraction, Multiplication, Addition, Division, Multiplication, Addition, Division, Modulus, Division Subtraction Subtraction Subtraction 18. Input/output function prototypes and macros are defined in which header file? A conio.h B stdlib.h C stdio.h D dos.h

19. What is the purpose of fflush() function.

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

A flushes all B flushes only C flushes D flushes file streams and specified input/output buffer. specified stream. buffer. streams. 20. What will the function randomize() do in Turbo C under DOS? A returns a random number. C returns a D return a random number random number generator with with a given a random value seed value based on time. 21. How will you free the memory allocated by the following program? #include<stdio.h> #include<stdlib.h> #define MAXROW 3 #define MAXCOL 4 int main() { int **p, i, j; p = (int **) malloc(MAXROW * sizeof(int*)); return 0; } A memfree(int B dealloc(p); C malloc(p, 0); p); B returns a random number generator in the specified range.

D free(p);

22. Which bitwise operator is suitable for checking whether a particular bit is on or off? A && operator B & operator C || operator D ! operator

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

23. How will you free the allocated memory ? A remove(varname); B free(varname); C delete(varname); D dalloc(varname);

24. Which of the following type of class allows only one object of it to be created? A Virtual class B Abstract class C Singleton class D Friend class

25. Which of the following function prototype is perfectly acceptable? A int Function(int Tmp = Show()); B float C Both A and B. Function(int Tmp = Show(int, float)); 26. How can we make a class abstract? A By making all member functions constant. D float = Show(int, float) Function(Tmp);

B By making at C By declaring it D By declaring it least one abstract using abstract using member the static the virtual function as pure keyword. keyword. virtual function. 27. For automatic objects, constructors and destructors are called each time the objects A enter and leave scope B inherit parent class C are constructed D are destroyed

28. Which of the following statement is correct?

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

A A B A reference is C A reference is D A reference is reference is stored on stack. stored in a stored in a stored on heap. queue. binary tree 29. Which of the following utilities can be used to compile managed assemblies into processor-specific native code? A gacutil B ngen C sn D dumpbin

30. Which of the following is NOT an Arithmetic operator in C#.NET? A ** B+ C/ D%

31. Which of the following statements is correct? A A constructor B C# provides a C Destructors D A class can can be used to copy are used with have more than set default constructor. classes as well one destructor. values and limit as structures. instantiation 32. Which of the following will be the correct output for the C#.NET code snippet given below? String s1 = "ALL MEN ARE CREATED EQUAL"; String s2; s2 = s1.Substring(12, 3); Console.WriteLine(s2); A ARE B CRE C CR D REA 33. Which of the following statements is correct about properties used in C#.NET?
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

A A property B A property C A write only D A write only can can be either property will property will simultaneously read only or have only get always return a be read only or write only. accessor. value. write only. 34. Which will legally declare, construct, and initialize an array? A int [] myList = {"1", "2", "3"}; B int [] myList = (5, 8, 2); C int myList [] [] = {4,9,7,0}; D int myList [] = {4, 3, 7};

35. Which is a reserved word in the Java programming language? A method B native C subclasses D reference

36. Which is a valid keyword in java? A interface B string C Float D unsigned

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus