Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (1 vote)
644 views

Firstsource Sample Programming Placement Paper Level1

The document provides information about sample programming placement papers, interview tips, and job updates. It directs the reader to visit www.latestoffcampus.com for placement papers and interview preparation resources. It also provides links to sign up for free job update emails and follow their Facebook page for live updates.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
644 views

Firstsource Sample Programming Placement Paper Level1

The document provides information about sample programming placement papers, interview tips, and job updates. It directs the reader to visit www.latestoffcampus.com for placement papers and interview preparation resources. It also provides links to sign up for free job update emails and follow their Facebook page for live updates.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

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: Firstsource Sample Programming Placement Paper Level1 (Bolded option is your answer) 1. Is there any difference between following declarations? 1 : extern int fun(); 2 : int fun(); A Both are B No difference, C int fun(); is D None of these identical except extern overrided with int fun(); is extern int fun(); probably in another file 2. In the following program where is the variable a getting defined and where it is getting declared? #include<stdio.h> int main() { extern int a; printf("%d\n", a); return 0; } int a=20; A extern int a is B int a = 20 is C int a = 20 is D a is declared, declaration, int declaration, definition, a is a is not defined a = 20 is the extern int a is not defined definition the definition 3. If the binary eauivalent of 5.375 in normalised form is 0100 0000 1010 1100 0000 0000 0000 0000, what will be the output of the program (on intel machine)? #include<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

#include<math.h> int main() { float a=5.375; char *p; int i; p = (char*)&a; for(i=0; i<=3; i++) printf("%02x\n", (unsigned char)p[i]); return 0; } A 40 AC 00 00 B 04 CA 00 00 C 00 00 AC 40

D 00 00 CA 04

4. Which statement will you add in the following program to work it correctly? #include<stdio.h> int main() { printf("%f\n", log(36.0)); return 0; } A B C D #include<conio. #include<math. #include<stdlib. #include<dos.h> h> h> h> 5. We want to round off x, a float, to an int value, The correct way to do is A y = (int)(x + 0.5) B y = int(x + 0.5) C y = (int)x + 0.5 D y = (int)((int)x + 0.5)

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

6. Which of the following statement obtains the remainder on dividing 5.5 by 1.3 ? A rem = (5.5 % 1.3) B rem = modf(5.5, 1.3) C rem = fmod(5.5, 1.3) D Error: we can't divide

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

8. 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);

D free(p);

9. Specify the 2 library functions to dynamically allocate memory? A malloc() and memalloc() B alloc() and memalloc() C malloc() and calloc() D memalloc() and faralloc()

10. How many times "IndiaBIX" is get printed?


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 x; for(x=-1; x<=10; x++) { if(x < 5) continue; else break; printf("IndiaBIX"); } return 0; } A Infinite times B 11 times

C 0 times

D 10 times

11. How many times the while loop will get executed if a short int is 2 byte wide? #include<stdio.h> int main() { int j=1; while(j <= 255) { printf("%c %d\n", j, j); j++; } return 0; }
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 Infinite times

B 255 times

C 256 times

D 254 times

12. How many times the program will print "IndiaBIX" ? #include<stdio.h> int main() { printf("IndiaBIX"); main(); return 0; } A Infinite times B 32767 times

C 65535 times

D Till stack overflows

13. What does the following declaration mean? int (*ptr)[10]; A ptr is array of B ptr is a pointer C ptr is an array D ptr is an pointers to 10 to an array of 10 of 10 integers pointer to array integers integers 14. What is the purpose of "rb" in fopen() function used below in the code? FILE *fp; fp = fopen("source.txt", "rb"); A open B open "source.txt" in "source.txt" in binary mode for binary mode for reading reading and writing

C Create a new file "source.txt" for reading and writing

D None of above

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

15. Which of the following operations can be performed on the file "NOTES.TXT" using the below code? FILE *fp; fp = fopen("NOTES.TXT", "r+"); A Reading B Writing

C Appending

D Read and Write

16. To print out a and b given below, which of the following printf() statement will you use? #include<stdio.h> float a=3.14; double b=3.14; A printf("%f %lf", a, b);

B printf("%Lf %f", a, b);

C printf("%Lf %Lf", a, b);

D printf("%f %Lf", a, b);

17. Which files will get closed through the fclose() in the following program? #include<stdio.h> int main() { FILE *fs, *ft, *fp; fp = fopen("A.C", "r"); fs = fopen("B.C", "r"); ft = fopen("C.C", "r"); fclose(fp, fs, ft); return 0; }
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.C" "B.C" "C.C"

B "B.C" "C.C"

C "A.C"

D Error in fclose()

18. What will the SWAP macro in the following program be expanded to on preprocessing? will the code compile? #include<stdio.h> #define SWAP(a, b, c)(c t; t=a, a=b, b=t) int main() { int x=10, y=20; SWAP(x, y, int); printf("%d %d\n", x, y); return 0; } A It compiles B Compiles with C Not compile an warning 19. How will you print \n on the screen? A printf("\n"); B echo "\\n"; C printf('\n'); D printf("\\n");

D Compiles and print nothing

20. Declare the following statement? "A pointer to an array of three chars". A char *ptr[3](); B char (*ptr)*[3]; C char (*ptr[3])(); D char (*ptr)[3];

21. Declare the following statement? "A pointer to a function which receives an int pointer and returns float pointer". A float B float C float D float *(ptr)*int; *(*ptr)(int) *(*ptr)(int*) (*ptr)(int)
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

22. Declare the following statement? "A pointer to a function which receives nothing and returns nothing". A void *(ptr)*int; B void *(*ptr)() C void *(*ptr)(*) D void (*ptr)()

23. Which of the following is the correct way of declaring a function as constant? A const int B int const C int D Both A and B ShowData(void) ShowData(void) ShowData(void) { /* statements { /* statements const { /* */ } */ } statements */ } 24. Which of the following ways are legal to access a class data member using this pointer? A this->x B this.x C *this.x D *this-x

25. What happens when we try to compile the class definition in following code snippet? class Birds {}; class Peacock : protected Birds {}; A It will not B It will not compile compile because because class class body of body of Birds is Eagle is not not defined. defined.

C It will not D It will compile compile succesfully. because a class cannot be protectedly inherited from other class. 26. Which of the following statements is correct about the program given below?
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

class Bix { public: static void MyFunction(); }; int main() { void(*ptr)() = &Bix::MyFunction; return 0; } A The program B The program C The program D The program reports an error reports an error reports an error reports linker as pointer to as pointer to as pointer to error. member static member member function cannot function cannot function cannot be defined be defined. be defined outside the without object. definition of class. 27. Which of the following function prototype is perfectly acceptable? A int Function(int Tmp = Show()); B float C Both A and B. D float = Function(int Show(int, float) Tmp = Show(int, Function(Tmp); float)); 28. What will be the output of the C#.NET code snippet given below? byte b1 = 0xF7; byte b2 = 0xAB; byte temp;
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

temp = (byte)(b1 & b2); Console.Write (temp + " "); temp = (byte)(b1^b2); Console.WriteLine(temp); A 163 92 B 92 163

C 192 63

D01

29. What will be the output of the C#.NET code snippet given below? int num = 1, z = 5; if (!(num <= 0)) Console.WriteLine( ++num + z++ + " " + ++z ); else Console.WriteLine( --num + z-- + " " + --z ); A56 B65 C66 30. Which of the following is an 8-byte Integer? A Char B Long C Short D Byte

D77

31. Which of the following is the correct ways to set a value 3.14 in a variable pi such that it cannot be modified? A float pi = 3.14F; B #define pi 3.14F; C const float pi = 3.14F; D const float pi; pi = 3.14F;

32. Which of the following statement correctly assigns a value 33 to a variable c? byte a = 11, b = 22, c;
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 c = (byte) (a + b);

B c = (byte) a + (byte) b;

C c = (int) a + (int) b;

D c = (int)(a + b);

33. Which of the following is the correct default value of a Boolean type? A0 B1 C True D False

34. When would a structure variable get destroyed? A When no B Depends upon C When it goes reference refers whether it is out of scope. to it, it will get created using garbage new or without collected. using new. 35. Which of the following statements is correct? A A struct never declares a default constructor. D Depends upon the Project Settings made in Visual Studio.NET.

B All value types C A struct never D In C#, classes in C# inherently declares a and structs are derive from default semantically ValueType, destructor. same. which inherits from Object. 36. Which of the following is the correct way to apply an attribute to an Assembly? A[ AssemblyDescri ption("DCube Component Library") ] B [ assembly : AssemblyDescri ption("DCube Component Library") ] C [ Assemblylnfo : AssemblyDescri ption("DCube Component Library") ] D < Assembly: AssemblyDescri ption("DCube Component Library") >

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

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

You might also like