{"id":125702,"date":"2020-12-07T10:24:36","date_gmt":"2020-12-07T04:54:36","guid":{"rendered":"https:\/\/www.aplustopper.com\/?p=125702"},"modified":"2020-12-08T11:06:18","modified_gmt":"2020-12-08T05:36:18","slug":"plus-two-computer-application-chapter-wise-previous-questions-chapter-1","status":"publish","type":"post","link":"https:\/\/www.aplustopper.com\/plus-two-computer-application-chapter-wise-previous-questions-chapter-1\/","title":{"rendered":"Plus Two Computer Application Chapter Wise Previous Questions Chapter 1 Review of C++ Programming"},"content":{"rendered":"
Question 1. Question 2. Question 3. Question 4. Question 5. Question 1. Question 2. Question 3. Question 1. Question 2. Question 3. Question 4. Kerala Plus Two Computer Application Chapter Wise Previous Questions Chapter 1 Review of C++ Programming Plus Two Computer Application\u00a0Review of C++ Programming 1 Mark Important Questions Question 1. _______ is an exit control loop. (MAY-2016) a) for loop b) while loop c) do-while loop d) break Answer: do-while loop Question 2. Which among the following […]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[42728],"tags":[],"yoast_head":"\n
\n_______ is an exit control loop. (MAY-2016)<\/span>
\na) for loop
\nb) while loop
\nc) do-while loop
\nd) break
\nAnswer:
\ndo-while loop<\/p>\n
\nWhich among the following is an Insertion Operator? (MARCH-2016)<\/span>
\na) <<
\nb) >>
\nc) <
\nd) >
\nAnswer:
\na) <<<\/p>\n
\nWhich among the following is equivalent to the statement series b=a, a = a +1 ? (MARCH-2017)<\/span>
\na) b + = a
\nb) b = a++
\nc) b = ++a
\nd) b + = a + b
\nAnswer:
\nb) b = a++<\/p>\n
\nA ______ statement in a loop force the termination of that loop. (MARCH-2017)<\/span>
\nAnswer:
\nbreak<\/p>\n
\n_______ operator is the arithmetic assignment operator. (MAY-2017)<\/span>
\na) >>
\nb) ==
\nc) +=
\nd) =
\nAnswer:
\nc) +=<\/p>\nPlus Two Computer Application\u00a0Review of C++ Programming 2 Marks Important Questions<\/h3>\n
\nHow does a \u2018goto\u2019 statement work? (MAY-2016)<\/span>
\nAnswer:
\nThe execution of a program is sequential but we can change this sequential manner by using jump statements. The jump statements are
\n1) goto statement By using goto we can transfer the control anywhere in the program without any condition. The syntax is goto label;
\nEg.
\n# include<iostream>
\nusing namespace std;
\nint main()
\n{
\nfloat a,b;
\ncout<<“Enter 2 numbers”;
\ncin>>a>>b;
\nif(b==0)
\ngoto end;
\ncout<<“The quotient is “<< a\/b;
\nreturn 0;
\nend:
\ncout<<“Division by zero error”;
\n}<\/p>\n
\nWhat are the main components of a looping statement ? (MARCH-2016)<\/span>
\nAnswer:
\nThe main components are initialization expression, test expression, update expression and looping body
\neg: for (i=1; i<=10; i++)
\ncout << i;<\/p>\n
\nIdentify the following C++ tokens. (MAY-2017)<\/span>
\na) “welcome”
\nb) int
\nc) >=
\nd) ++
\nAnswer:
\na) \u201cwelcome\u201d String Literal
\nb) int-Keyword
\nc) >= Operator
\nd) ++-: Operator<\/p>\nPlus Two Computer Application\u00a0Review of C++ Programming 3 Marks Important Questions<\/h3>\n
\nExplain switch statement with an example (MAY-2016)<\/span>
\nAnswer:
\ncin >> pcode;
\nswitch (pcode)
\n{
\ncase \u2018C\u2019:
\ncout <<\u201cComputer”;
\nbreak;
\ncase \u2018M\u2019:
\ncout << \u201cMobile Phone\u201d;
\nbreak;
\ncase \u2019L\u2019:
\ncout << \u201cLaptop\u201d;
\nbreak;
\ndefault:
\ncout << \u201clnvalid code\u201d;<\/p>\n
\nRewrite the following C++ code using \u2018switch\u2019 statement (MARCH-2017)<\/span>
\ncin >> pcode;
\nif (pcode == \u2018C\u2019)
\ncout << \u201cComputer\u201d;
\nelse if (pcode == \u2018M\u2019)
\ncout<<\u201cMobile Phone\u201d;
\nelse if(pcode == \u2018L\u2019)
\ncout<<\u201cLaptop
\nelse
\ncout<<\u201clnvalid code\u201d;
\nAnswer:
\ncin >> pcode;
\nswitch(pcode)
\n{
\ncase \u2018C\u2019:
\ncout << \u201cComputer\u201d;
\nbreak;
\ncase \u2018M\u2019:
\ncout << \u201cMobile Phone\u201d;
\nbreak;
\ncase \u2019L\u2019:
\ncout << \u201cLaptop\u201d;
\nbreak;
\ndefault:
\ncout << \u201clnvalid code”;<\/p>\n
\nHow do continue and break statement differ in a loop? Explain with an example. (MARCH-2016)<\/span>
\nAnswer:
\nBreak is used to terminate a loop. But continue is used for skipping (by passing) a part of the code, eg: for (i=1, i<10; i++)
\n{
\nif (i%2==0) continue; cout<<i << \u201c, \u201c;
\n}
\nHere the output is 1,3, 5, 7, 9
\neg: for (i=1; i<10; i++)
\n{
\nif (i% 2==0) break;
\ncout<<i<<\u201c,\u201d;
\n}
\nHere the output is 1, that is the loop is quit when i=2.<\/p>\n
\nExplain break and continue statements with example. (MAY-2017)<\/span>
\nAnswer:
\nbreak statement:-<\/strong> It is used to skip over a part of the code i.e. we can premature exit from a loop such as while, do-while, for or switch, continue statement:- It bypasses one iteration of the loop.
\nbreak statement:-<\/strong> It is used to skip over a part of the code i.e. we can premature exit from a loop such as while, do-while, for or switch.
\nSyntax :<\/strong>
\nwhile (expression)
\nif (condition) break;
\n}
\nEg.
\n#include<iostream>
\nusing namespace std;
\nint main()
\n{
\nint i=1;
\nwhile(i<10)
\n{
\ncout<<i<<endl;
\nif(i==5)
\nbreak;
\ni++;
\n}
\n}
\nThe output is<\/strong>
\n1
\n2
\n3
\n4
\n5
\ncontinue statement:-<\/strong> It bypasses one iteration of the loop.
\nSyntax:
\nwhile (expression)
\n{
\nif (condition) break;
\n}
\nEg.
\n#include<iostream>
\nusing namespace std;
\nint main()
\n{
\nint i=0;
\nwhile(i<10)
\n{
\ni++;
\nif(i==5) continue;
\ncout<<i<<endl;
\n}
\n}
\nThe output is<\/strong>
\n1
\n2
\n3
\n4
\n5
\n6
\n7
\n8
\n9
\n10<\/p>\nPlus Two Computer Application Chapter Wise Previous Questions and Answers<\/a><\/h4>\n","protected":false},"excerpt":{"rendered":"