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 correct JavaScript syntax to change the content of the HTML element below? <p id="demo">This is a demonstration.</p> document.getElementById("demo").innerHTML = "Hello World!"; document.getElementByName("p").innerHTML = "Hello World!"; #demo.innerHTML = "Hello World!"; document.getElement("p").innerHTML = "Hello World!"; 3. Which superglobal variable holds information about headers, paths, and script locations? $_GLOBALS $_SERVER $_SESSION $_GET[]; 4. HTML If the image cannot be displayed then _______ specifies an alternate text for an image. text attribute value attribute caption attribute alt attribute 5. What is the correct way to open the file "time.txt" as readable? fopen("time.txt","r"); open("time.txt","read"); fopen("time.txt","r+"); open("time.txt"); 6. 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. B D C A 7. 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 B A D 8. What is the output of the following: #include<stdio.h> 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 A C D B 9. PHP Which one of the following is the right way to clone an object in PHP? destinationObject = _clone(targetObject); destinationObject = clone targetObject; _clone(targetObject); destinationObject = clone(targetObject); 10. What is the correct way to end a PHP statement? New line /php ; . 11. 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]); } mmm aa nnn aaaa mmmm nnnn mmmm aaaa nnnn mmmm aa nn 12. #include<stdio.h> #include<conio.h> 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 B A C D 13. 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 D B C 14. 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. D C B A 15. What is the time complexity of merge sort?(Best case) O(n^2) O(log (n)) O(n log(n)) O(n) 16. #include main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); } 3hello 3 hello Compiler error 17. Which of the following approach is adapted by C++? A. Top-down B. Bottom-up C. Right-left D. Left-right C D A B 18. Where can the super() appear in the base class? First line of base class constructor. Anywhere in the base class constructor. Anywhere in the base class. Just after the instantiating line. 19. #include<stdio.h> 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 20. #include<stdio.h> 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 B A C D 21. #include <iostream> 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. D A C B 22. PHP allows you to send emails directly from a script True False 23. CSS How do you add a background color for all <h1> HTML elements? h1 {background-color:#FFFFFF;} all.h1 {background-color:#FFFFFF;} h1.all {background-color:#FFFFFF;} 24. #define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); } sizeof(i)=2 sizeof(i)=1 Depends on compiler sizeof(i)=65 25. JVM is platform independent. A.True B.False False True 26. HTML C Which type of files can’t be opened using fopen()? .bin .c None of the mentioned .txt 27. Which of the following is illegal? int i; double* dp = &i; string s, *sp = 0; int *ip; int *pi = 0; 28. 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. D C A B 29. 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 30. void print(int n) { if (n == 0) return; printf("%d", n%2); print(n/2); } What will be the output of print(12). 1000 1100 1001 0011 Be sure to click Submit Quiz to see your results! Time's up