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