You are on page 1of 14

OBJECTIVE QUESTIONS IN MICROPROCESSOR 1. Accesstime is faster for (a)ROM (b) SRAM (c) DRAM (d) EPROM 2.

In 8255, under the I/O mode of operation, we have modes (a)3 (b)2 (c)4 (d)1 3. Under which mode of 8255, it will have the following features (i)A 5-bit control port is available (ii) 3, I/O lines are available at port C (a)mode 2 (b)mode 0 (c)mode 1 (d) mode 3 4. For the most static RAM, the write pulse width should be at least (A) 10ns (b) 60ns (c) 300ns (d) 1micro sec 5. BURST refresh in DRAM is also called as (a)Concentrated Refresh (b)Distributed Refresh (c)Hidden Refresh (d)None 6. For the most static RAM, the maximum access time is about (A) 1ns (b) 10ns (c) 100ns (d) 1 micro sec 7.8086 microP is interfaced to 8253 Programmable Interval Timer, the maximum number by which the clk frequency on one of the timer is divided by, (a) 216 (b) 28 (c) 210 (d) 220 8.8086 is interfaced to two 8259s (programmable Interval Timer) .If 8259s are in Master slave configuration, the number of interrupts available to the 8086 Microprocessor is (A) 8 (b) 16 (c) 15 (d) 64 9. Which interrupts has highest Priority (a)INTR (b) TRAP (c) RST 7.5 (d) RST6.5 10. In 8085 name the 16 bit registors. (a)Stack Pointer (b) Program Counter (c) IR (d) a and b 11. What is RST for the TRAP? (a)RST5.5 (b) RST4.5 (c) RST4 (d) RST 5 12. Which of the following is a hardware interrupt? (a)RST 5.5, RST 6.5, RST 7.5 (b)INTR, TRAP (c)TRAP (d) A and b 13. What are level triggering interrupts? (a)RST 6.5 and RST5.5 (b)RST7.5 and RST 6.5 (c)RST 5.5 and RST7.5 (d)INTR and TRAP 14. What is SIM? A) Select interrupt mask B) Sorting interrupt mask C) Set interrupt mask D) Softer interrupt mask 15. What is software interrupt? A) RSTO-7 B) RST5.5 -RST 7.5 C) INTR D) TRAP 16. Which stack in 8085? A) FIFO B) LIFO C) FILO D) LILO 17. Address line for TRAP IS a)0023H B)0024H C)0033H D)0034H 18. Rim is used to check whether----------------? A) The write operation is done or not. B) The interrupt is masked or not. C) The read operation is done or not. D) A&b 19. In 8085, example for non maskable interrupts is A) TRAP B) RST 6.5 C) INTR D) RST 5.5 20. What does mp speed depends on? A)Clock B) Data bus width C) Address bus width D) Size of register 21. Can ROM be used as stack? A) Yes B) No C) Sometimes yes D) Sometimes no 22. Which processor structure is pipelined? A) Aii x80 processor B) All x 85 processor C) All x 86 processor D) Pentium 23. Address line for RST 3 is A)0020H B)0028H C)0018H D)0038H 24. In 8086 the over flow flag is set when

A) The sum is more than 16 bit B) Signed numbers go out of their range after an arithmetic operation. C) Carry&Sign flag are set. D) Zero flag is set. 25. The advantage of memory mapped I/O over I/O mapped I/O is A) Faster B) Many instructions supporting memory mapped I/O C) Require a bigger address decoder D) All of the above. 26. BHE of 8086 processor signal is used to interface the A) Even bank memory B) Odd bank memory C) I/O D) DMA 27.In 8086 the following has the highest priority among all the interrupts A) NMI B) DIV O C) TYPE 255 D) OVER FLOW 28. In8085 are of the following statements is not true A) Co processor is interfaced in max mode. B) Co processor is interfaced in mIN mode C) Co processor is interfaced in max/min mode. D) Supportspipelining. 29.8088 differs 8086 in A) Data width on the output B) Supports of Co-processor. C) Address capability D) Supports of max/min mode. JAVA QUESTIONS: 1. What will be the output of the program? ClassMyThread extends Thread { Mythread () { System.out.print(" MyThread"); } public void run() { System.out.print(" bar"); } public void run(String s) { System.out.println(" baz"); } } public class TestThreads { public static void main (String [] args) { Thread t = new MyThread() { public void run() { System.out.println(" foo"); } }; t.start(); } } A. fooB. MyThread foo C. MyThread bar D. Foo bar 2. What will be the output of the program? class MyThread extends Thread { public static void main(String [] args) { MyThread t = new MyThread(); t.start(); System.out.print("one. ");

t.start(); System.out.print("two. "); } public void run() { System.out.print("Thread "); } } A. Compilation fails B. An exception occurs at runtime. C. It prints "Thread one. Thread two." D. The output cannot be determined. 3. What will be the output of the program? class MyThread extends Thread { MyThread() {} MyThread(Runnable r) {super(r); } public void run() { System.out.print("Inside Thread "); } } classMyRunnable implements Runnable { public void run() { System.out.print(" Inside Runnable"); } } class Test { public static void main(String[] args) { new MyThread().start(); new MyThread(new MyRunnable()).start(); } } A. Prints "Inside Thread Inside Thread" B. Prints "Inside Thread Inside Runnable" C. Does not compile D. Throws exception at runtime 4. What will be the output of the program? class s1 implements Runnable { int x = 0, y = 0; intaddX() {x++; return x;} intaddY() {y++; return y;} public void run() { for(int i = 0; i < 10; i++) System.out.println(addX() + " " + addY()); } public static void main(String args[]) { s1 run1 = new s1(); s1 run2 = new s1(); Thread t1 = new Thread(run1); Thread t2 = new Thread(run2); t1.start(); t2.start(); }

} A. Compile time Error: There is no start() method B. Will print in this order: 1 1 2 2 3 3 4 4 5 5... C. Will print but not exactly in an order (e.g: 1 1 2 2 1 1 3 3...) D. Will print in this order: 1 2 3 4 5 6... 1 2 3 4 5 6... 5. What will be the output of the program? public class Q126 implements Runnable { private int x; private int y; public static void main(String [] args) { Q126 that = new Q126(); (new Thread(that)).start( ); /* Line 8 */ (new Thread(that)).start( ); /* Line 9 */ } public synchronized void run( ) /* Line 11 */ { for (;;) /* Line 13 */ { x++; y++; System.out.println("x = " + x + "y = " + y); } } } A. An error at line 11 causes compilation to fail B. Errors at lines 8 and 9 cause compilation to fail. C. The program prints pairs of values for x and y that might not always be the same on the same line (for example, "x=2, y=1") D. The program prints pairs of values for x and y that are always the same on the same line (for example, "x=1, y=1". In addition, each value appears once (for example, "x=1, y=1" followed by "x=2, y=2") 6. What is the name of the method used to start a thread execution? A. init(); B. start(); C. run(); D. resume(); 7. Which two are valid constructors for Thread? 1. Thread(Runnable r, String name) 2. Thread() 3. Thread(int priority) 4. Thread(Runnable r, ThreadGroup g) 5. Thread(Runnable r, int priority) A. 1 and 3 B. 2 and 4 C. 1 and 2 D. 2 and 5 8. Which three are methods of the Object class? 1. notify(); 2. notifyAll(); 3. isInterrupted(); 4. synchronized(); 5. interrupt(); 6. wait(long msecs); 7. sleep(long msecs); 8. yield(); A. 1, 2, 4 B. 2, 4, 5 C. 1, 2, 6 D. 2, 3, 4 9. class X implements Runnable {

public static void main(String args[]) { /* Missing code? */ } public void run() {} } Which of the following line of code is suitable to start a thread ? A. Thread t = new Thread(X); B. Thread t = new Thread(X); t.start(); C. X run = new X(); Thread t = new Thread(run); t.start(); D. Thread t = new Thread(); x.run(); 10. Which cannot directly cause a thread to stop executing? A. Calling the SetPriority() method on a Thread object. B. Calling the wait() method on an object. C. Calling notify() method on an object. D. Calling read() method on an InputStream object. C QUESTIONS/ C++ QUESTIONS: Predict the output or error(s) for the following: 1. structaaa{ structaaa *prev; int i; structaaa *next; }; main() { structaaaabc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); } 2. struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); } 3. main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); } 4. main() { char *p;

int *q; long *r; p=q=r=0; p++; q++; r++; printf("%p...%p...%p",p,q,r); } 5. main() { char c=' ',x,convert(z); getc(c); if((c>='a') && (c<='z')) x=convert(c); printf("%c",x); } convert(z) { return z-32; } 6. Find the output of the following program class Sample { public: int *ptr; Sample(int i) { ptr = new int(i); } ~Sample() { delete ptr; } void PrintVal() { cout << "The value is " << *ptr; } }; void SomeFunc(Sample x) { cout << "Say i am in someFunc " <<endl; } int main() { Sample s1= 10; SomeFunc(s1); s1.PrintVal(); } 7. Find the output of the following program class base { public: int bval; base(){ bval=0;} }; class deri:public base { public: int dval; deri(){ dval=1;}

}; void SomeFunc(base *arr,int size) { for(int i=0; i cout<bval; cout< } int main() { base BaseArr[5]; SomeFunc(BaseArr,5); deriDeriArr[5]; SomeFunc(DeriArr,5); } 8. Find the output of the following program class base { public: void baseFun(){ cout<<"from base"< }; class deri:public base { public: void baseFun(){ cout<< "from derived"< }; void SomeFunc(base *baseObj) { baseObj->baseFun(); } int main() { base baseObject; SomeFunc(&baseObject); derideriObject; SomeFunc(&deriObject); } 9. Find the output of the following program class base { public: virtual void baseFun(){ cout<<"from base"< }; class deri:public base { public: void baseFun(){ cout<< "from derived"< }; void SomeFunc(base *baseObj) { baseObj->baseFun(); } int main() { base baseObject; SomeFunc(&baseObject); derideriObject; SomeFunc(&deriObject); } 10. Find the output of the following program void main ( )

{ int a, *pa, &ra; pa = &a; ra = a; cout <<"a="<<<"*pa="<<*pa <<" ra"< } <<"*pa="<<*pa <<" ra"< 11. Find the output of the following program<<"*pa="<<*pa <<" ra"< const int size = 5; void print(int *ptr) { cout< } void print(int ptr[size]) { cout< } void main() { int a[size] = {1,2,3,4,5}; int *b = new int(size); print(a); print(b); } 12. Find the output of the following program<<"*pa="<<*pa <<" ra"< class some{ public: ~some() { cout<<"some's destructor"< } }; void main() { some s; s.~some(); } 13. Find the output of the following program<<"*pa="<<*pa <<" ra"< #include class fig2d { int dim1; int dim2; public: fig2d() { dim1=5; dim2=6;} virtual void operator<<(ostream & rhs); }; void fig2d::operator<<(ostream &rhs) { rhs <dim1<<" "<dim2<<" "; } /*class fig3d : public fig2d { int dim3; public: fig3d() { dim3=7;} virtual void operator<<(ostream &rhs); }; void fig3d::operator<<(ostream &rhs) {

fig2d::operator <<(rhs); rhs<dim3; } */ void main() { fig2d obj1; // fig3d obj2; obj1 << cout; // obj2 << cout; } 14. Find the output of the following program<<"*pa="<<*pa <<" ra"< class opOverload{ public: bool operator==(opOverload temp); }; bool opOverload::operator==(opOverload temp){ if(*this == temp ){ cout<<"The both are same objects\n"; return true; } else{ cout<<"The both are different\n"; return false; } } void main(){ opOverload a1, a2; a1= =a2; } 15. Find the output of the following program<<"*pa="<<*pa <<" ra"< class complex{ double re; double im; public: complex() : re(1),im(0.5) {} bool operator==(complex &rhs); operator int(){} }; bool complex::operator == (complex &rhs){ if((this->re == rhs.re) && (this->im == rhs.im)) return true; else return false; } int main(){ complex c1; cout<< c1; } 16. main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }

17. # include int one_d[]={1,2,3}; main() { int *ptr; ptr=one_d; ptr+=3; printf("%d",*ptr); } 18. Predict the output or error(s) for the following: # include aaa() { printf("hi"); } bbb(){ printf("hello"); } ccc(){ printf("TechPreparation.com"); } main() { int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc; ptr[2](); } 19. #include main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); } 20. main() { int i; i = abc(); printf("%d",i); } abc() { _AX = 1000; } 21. Predict the output of the following: void main() { char a[6] = "INDIA"; while(*a) { printf("%c",*a); a++; } } A) india B) I N D I A C)no output D) error E)Null 22. Find the output of the following program int m = 10;

main() { int m = 20; {int m = 30;} printf("%d %d",m,::m); A) 10 10 B) 10 20 C) 20 10 D) 20 30 E) 30 20 F) None 23. inline function is used to A) reduce program size B) reduce memory size 24. Find the output of the following program void func(float newtotal) { newtotal = newtotal-2; } main() { float tot = 100.34; float sum = tot; sum++; func(sum); cout< } A) 100.34 B) 99.34 C) 101.34 D) 102.34 E) None 25. Find the output of the following program unsigned char snapnib(unsigned char misc) { int aloha, hamalo; hamalo = aloha = misc; misc = (hamalo<< 4)+((aloha & 0x0f)>>4); return(misc); } main() { int getinp; unsig char getmisc; scanf("%x",&getinp); getmisc = snapnib(getinp& 0xff); printf("%x",getmisc); } A) Change line 4 to misc = (hamalo>> 4)+((aloha &oxof)<<4); B) remove the 5 C) Change line 4 to misc = (hamalo>> 4)+((aloha &oxfo)<<4); D) Change line 11 to getmisc = snapnib(getinp); E) Nothing 26. Find the output of the following program main() { int getinp = 6; while(--getinp) { printf("%d",getinp); if(getinp++ != 3); else break; if(getinp-- != 5) continue; else getinp = getinp - 2; } A) 5421 B) 5420 C) 541 D) 6543 E) 5410 27. Find the output of the following program unsigned char inn[2] = "5";

int i,j = 0; sscanf(inn,"%d",&i); while(i) { i = i - 1; j++; printf("%d",++j); } A) 14 B)12 C)24 D)35 E)none 28. Find the output of the following program char *fn(int num) { char a[] = "Amen"; return(&a[num]); } main() { int i; char *prechar; scanf("%d",&i); (input is 12) prechar = fn(i); printf("%c",*prechar); } A) a bus B) give string "Amen" as global C) use return(a[num]) instead of return(&a[num]) D) give main before fn 29. Find the output of the following program unsigned char u = 32767; unsigned char y = 32768; u = u + y; printf("%d",(signed char)u); A) 65535 B) -65535 C) -1 D) 1 E)none 30. Find the output of the following program *name = "ANYTHING"; *foo = "ALRIGHT"; *name1 = "WRONG"; strcat(name,name1); printf("%s %s ",name,foo); return(0); A) ANYTHING WRONG? WRONG? B) ANYTHING C) ANYTHING WRONG?ALRIGHT D)ERROR E) NONE LOGICAL REASONING QUESTIONS 1. A bus runs at 100 km/hr. top speed. It can carry a maximum of 6 Persons. If speed of bus decreases in fixed proportion with increase in Numberof person, find speed when three persons are traveling in bus. 2. A man wanted to enter an exclusive club but did not know the password that was required. He waited by the door and listened. A club member nocked on the door and the doorman said, "twelve." The member replied, "six" and was let in. A second member came to the door and the doorman said,

"six." The member replied, "three" and was let in. The man thought he had heard enough and walked up to the door. The doorman said, "ten" and the man replied, "five". But he was not let in. What should have he said? 3. There are 20 pieces of bread to divide among 20 people. A man eats 3 pieces, woman eats 2 pieces and a child eats half piece of bread. Tell the correct combination of men, women and children so that they are 20 people in total and everyone gets the bread. Note that a man cannot eat less than 3 or more than 3. A woman cannot eat less than 2 or more than 2 and the child cannot eat less than half or more than half piece of the bread. You have to tell there are how may are men, women and children in those 20 people. 4. In the middle of a round pool lies a beautiful water-lily. The water-lily doubles in size every day. After exactly 20 days the complete pool will be covered by the lily. After how many days will half of the pool be covered by the water-lily? 5. How many squares are there in a normal Chess board? 6. A snail is at the bottom of a 20 meters deep pit. Every day the snail climbs 5 meters upwards, but at night it slides 4 meters back downwards. How many days does it take before the snail reaches the top of the pit? 7. At a party, everyone shook hands with everybody else. There were 66 handshakes. How many people were at the party? 8. If 5+3+2 = 151012, 9+2+4 = 183662, 8+6+3 =482466, 5+4+5 = 202504 then what will be the answer of 7+2+5? 9. The sum of ages of 5 children born at the intervals of 3 years each is 50 years. What is the age of the youngest child? 10. The difference between a two-digit number and the number obtained by interchanging the positions of its digits is 36. What is the difference between the two digits of that number? 11. 3 types of chickens : Baby chickens cost 5 cents, hen chickens cost 3 dollares, rooster chickens cost 5 dollars. Buy 100 chickens for 100 dollars. How many will you have from each? 12. Calculate : (x-a)(x-b)(x-c)....(x-z)? 13. What is the day after 4 days after 2 days before the day before tomorrow? 14. 2 trains each of length 1 mile enter into 2 tunnels of lenth 1 mile and 2 miles apart. speed if trains are 5 and 10 miles/hr. Give the postion as viewed by a helicopter when the trains meet? 15. A says I'm not guilty ; B says C is not guilty ; C says A is not guilty - If all above are true. (i) Can we say anyone is guilty/innocent? (ii)Who is most likely to be guilty? 16. 18 story building - Accountant's office is 5 times the lawyer's office. Architects office 2 floors up then he is halfway between Dentist's & Accountant's office. Architects office halfway down means between Dentist's and Lawyer's office. Give the order? 17. How many tennis matches are to be arranged to conduct a tournament with 213 players? 18. In a family 7 children don't eat spinach, 6 don't eat carrot, 5 don't eat beans, 4 don't eat spinach & carrots, 3 don't eat carrot & beans, 2 don't eat beans & spinach. 1 doesn't eat all 3. Find the no. of

children.

You might also like