May 27, 2016 0 Welcome to your Yipee Technology Online Aptitude Test 2 Name Email Phone Number 1. How do you get information from a form that is submitted using the "get" method? $_GET[]; Request.Form; Request.QueryString; 2. What is the output of the following: #include int fun(int count) { printf("%d\n", count); if(count < 3) { fun(fun(fun(++count))); } return count; } int main() { fun(1); return 0; } A. 1 2 3 3 3 3 3 B. 1 2 3 C. 1 2 2 2 2 2 2 D. 1 2 B A D C 3. JAVA: When compiler provides default constructor? A. Only if there is no explicit constructor defined by developer. B. Each time. C. Only when there is an explicit constructor defined by developer. D. Never. B D A C 4. Where can the super() appear in the base class? Just after the instantiating line. Anywhere in the base class. Anywhere in the base class constructor. First line of base class constructor. 5. Which of the following approach is adapted by C++? A. Top-down B. Bottom-up C. Right-left D. Left-right A B C D 6. #include int main(){ int i,j; i=j=2,3; while(--i&&j++) printf("%d %d",i,j); return 0; } A.1 3 B.2 3 C.1 2 D.1 2 3 A C B D 7. void print(int n) { if (n == 0) return; printf("%d", n%2); print(n/2); } What will be the output of print(12). 1100 1000 1001 0011 8. What will be the output of the following class equality { int x; int y; boolean isequal() { return(x == y); } } class Output { public static void main(String args[]) { equality obj = new equality(); obj.x = 5; obj.y = 5; System.out.println(obj.isequal()); } } 1 Compilation Error True fasle 9. #include #include int main(){ void (*p)(); int (*q)(); int (*r)(); p = clrscr; q = getch; r = puts; (*p)(); (*r)("cquestionbank.blogspot.com"); (*q)(); return 0; } (A) NULL (B) cquestionbank.blogspot.com (C) c (D) Compilation error (E) None of above D C B A 10. JVM is platform independent. A.True B.False False True 11. What is the correct way to end a PHP statement? . New line /php ; 12. #include int main() { int a=10; void f(); a = f(); printf("%d\n", a); return 0; } void f() { printf("Hi"); } A. Error: Not allowed assignment B. Error: Doesn't print anything C. No error D. None of above A C D B 13. What is the correct way to open the file "time.txt" as readable? open("time.txt"); fopen("time.txt","r"); open("time.txt","read"); fopen("time.txt","r+"); 14. HTML If the image cannot be displayed then _______ specifies an alternate text for an image. caption attribute alt attribute text attribute value attribute 15. Java: class A { int i; void display() { System.out.println(i); } } class B extends A { int j; void display() { System.out.println(j); } } class inheritance_demo { public static void main(String args[]) { B obj = new B(); obj.i=1; obj.j=2; obj.display(); } } a) 0 b) 1 c) 2 d) Compilation Error C A B D 16. CSS How do you add a background color for all HTML elements? all.h1 {background-color:#FFFFFF;} h1 {background-color:#FFFFFF;} h1.all {background-color:#FFFFFF;} 17. JAVA: What will be the output of the program? public class Foo { public static void main(String[] args) { try { return; } finally { System.out.println( "Finally" ); } } } A. Finally B. Compilation fails. C. The code runs with no output. D. An exception is thrown at runtime. C B A D 18. Which of the following is illegal? int i; double* dp = &i; int *ip; string s, *sp = 0; int *pi = 0; 19. #define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); } sizeof(i)=65 sizeof(i)=2 sizeof(i)=1 Depends on compiler 20. PHP allows you to send emails directly from a script True False 21. #include using namespace std; class B { public: void display() { cout<<"Content of base class.\n"; } }; class D : public B { public: void display() { cout<<"Content of derived class.\n"; } }; int main() { B *b; D d; b->display(); b = &d; /* Address of object d in pointer variable */ b->display(); return 0; } A.Content of base class. Content of base class. B.Content of base class. Conitent of derived class. C.Content of derived class. Content of base class. D.Conitent of derived class. Conitent of derived class. C B D A 22. Which superglobal variable holds information about headers, paths, and script locations? $_GLOBALS $_SERVER $_SESSION $_GET[]; 23. What is the correct JavaScript syntax to change the content of the HTML element below? This is a demonstration. document.getElementByName("p").innerHTML = "Hello World!"; document.getElement("p").innerHTML = "Hello World!"; document.getElementById("demo").innerHTML = "Hello World!"; #demo.innerHTML = "Hello World!"; 24. void main() { char s[ ]="man"; int i; for(i=0;s[ i ];i++) printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]); } aaaa mmmm nnnn mmmm aa nn mmmm aaaa nnnn mmm aa nnn 25. What is the time complexity of merge sort?(Best case) O(log (n)) O(n) O(n log(n)) O(n^2) 26. Which of the following statements is correct? A. Base class pointer cannot point to derived class. B. Derived class pointer cannot point to base class. C. Pointer to derived class cannot be created. D. Pointer to base class cannot be created. C A B D 27. Can you combine the following two statements into one? char *p; p = (char*) malloc(100); A. char p = *malloc(100); B. char *p = (char) malloc(100); C. char *p = (char*)malloc(100); D. char *p = (char *)(malloc*)(100); A B C D 28. HTML C Which type of files can’t be opened using fopen()? .txt .bin None of the mentioned .c 29. #include main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); } Compiler error 3 hello 3hello 30. PHP Which one of the following is the right way to clone an object in PHP? destinationObject = _clone(targetObject); _clone(targetObject); destinationObject = clone targetObject; destinationObject = clone(targetObject); Be sure to click Submit Quiz to see your results! Time's up