{"id":25502,"date":"2022-01-25T17:52:35","date_gmt":"2022-01-25T12:22:35","guid":{"rendered":"https:\/\/infinitylearn.com\/surge\/?p=25502"},"modified":"2022-01-25T17:52:35","modified_gmt":"2022-01-25T12:22:35","slug":"important-questions-for-class-12-computer-science-c-pointers","status":"publish","type":"post","link":"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/","title":{"rendered":"Important Questions for Class 12 Computer Science (C++) \u2013 Pointers"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_37 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" style=\"display: none;\"><label for=\"item\" aria-label=\"Table of Content\"><span style=\"display: flex;align-items: center;width: 35px;height: 30px;justify-content: center;\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/label><input type=\"checkbox\" id=\"item\"><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' style='display:block'><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/#Important_Questions_for_Class_12_Computer_Science_C_-_Pointers\" title=\"Important Questions for Class 12 Computer Science (C++) \u2013 Pointers\">Important Questions for Class 12 Computer Science (C++) \u2013 Pointers<\/a><ul class='ez-toc-list-level-3'><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/#Previous_years_Examination_Questions_2_Marks_Questions\" title=\"Previous years Examination Questions \n2 Marks Questions\">Previous years Examination Questions \n2 Marks Questions<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Important_Questions_for_Class_12_Computer_Science_C_-_Pointers\"><\/span><span style=\"color: #00ccff\"><strong>Important Questions for Class 12 Computer Science (C++) \u2013 Pointers<\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3 style=\"text-align: center\"><span class=\"ez-toc-section\" id=\"Previous_years_Examination_Questions_2_Marks_Questions\"><\/span><span style=\"color: #0000ff\">Previous years Examination Questions<\/span><br \/>\n<span style=\"color: #0000ff\">2 Marks Questions<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"color: #eb4924\"><strong>Question 1:<br \/>\n<\/strong><\/span>Obtain the output from the following C++ program as expected to appear on the screen after its execution. <strong>Delhi 2014<\/strong><br \/>\n<strong>Important Note:<\/strong><br \/>\nAll the desired header files are already included in the code, which are required to run the code.<\/p>\n<pre>void main()\r\n{\r\nchar*String=\"SARGAM\"; \r\nint *Ptr, A[]={l,5,7,9};\r\nPtr=A; \r\ncout&lt;&lt;*Ptr&lt;&lt;String&lt;&lt;endl;\r\nString++;\r\nPtr+=3;\r\ncout&lt;&lt;*Ptr&lt;&lt;String&lt;&lt;endl;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\n1SARGAM<br \/>\n9ARGAM<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 2:<br \/>\n<\/strong><\/span>Obtain the output from the following C+ + program as expected to appear on the screen after its execution. <strong>All India 2014.2013<\/strong><br \/>\n<strong>Important Note:<\/strong><br \/>\nAll the desired header files are already included in the code, which are required to run the code.<\/p>\n<pre>void main()\r\n{\r\nchar *Text = \"AJANTA\"; \r\nint *P,Num[] = {11,5,7,9};\r\nP = Num;\r\ncout&lt;&lt;*P&lt;&lt;Text&lt;&lt;endl;\r\nText++;\r\nP++;\r\ncout&lt;&lt;*P&lt;&lt;Text&lt;&lt;endl;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\n1AJANTA<br \/>\n5JANTA<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 3:<br \/>\n<\/strong><\/span>Observe the following C+ + code carefully and obtain the output, which will appear on the screen after execution of it.<br \/>\n<strong>Delhi 2013<br \/>\nImportant Note:<\/strong><br \/>\nAll the desired header files are already included in the code, which are required to run the code.<\/p>\n<pre>void main()\r\n{\r\nchar *String = \"SHAKTI\"; \r\nint *Point, Value[]={10,15,70,19};\r\nPoint = Value;\r\ncout&lt;&lt;*Point&lt;&lt;String&lt;&lt;endl;\r\nString++;\r\nPoint++;\r\ncout&lt;&lt;*Point&lt;&lt;String&lt;&lt;endl;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\n10SHAKTI<br \/>\n15HAKTI<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 4:<br \/>\n<\/strong><\/span>Give the output of the following program segment: (Assuming, all desired header file(s) are already included). <strong>Delhi 2013C<\/strong><\/p>\n<pre>void main()\r\n{\r\nfloat *Ptr,Points[] = {120,50,30,40,10};\r\nPtr=Points; \r\ncout&lt;&lt;*Ptr&lt;&lt;endl;\r\nPtr+=2;\r\nPoints[2]+=2.5; \r\ncout&lt;&lt;*Ptr&lt;&lt;endl:\r\nPtr++;\r\n(*Ptr)+=2.5; \r\ncout&lt;&lt;Points[3]&lt;&lt;endl;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\n20<br \/>\n32.5<br \/>\n42.5<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 5:<br \/>\n<\/strong><\/span>Find the output of the following program: <strong>All India 2012<\/strong><\/p>\n<pre>#include&lt;iostream.h&gt; \r\n#include&lt;conio.h&gt;\r\n#include&lt;ctype.h&gt; \r\ntypedef char Str80[80]; \r\nvoid main() \r\n{\r\nchar *Notes;\r\nStr80 Str=\"vR.zGooD\";\r\nint L=6;\r\nNotes = Str; \r\nwhile(L&gt;=3)\r\n{\r\nStr[L]=isupper(Str[L])?\r\ntolower(Str[L]); \r\ntoupper(Str[L]); \r\ncout&lt;&lt;Notes&lt;&lt;endl;\r\nL--;\r\nNotes++; \r\ngetch();\r\n}\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\nvR.zGoOd<br \/>\nR.zGOOD<br \/>\n.zgOOD<br \/>\nZgOOD<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 6:<br \/>\n<\/strong><\/span>Find the output of the following program: <strong>Delhi 2012<\/strong><\/p>\n<pre>#include&lt;iostream.h&gt; \r\n#include&lt;conio.h&gt;\r\n#include&lt;ctype.h&gt; \r\ntypedef char Txt80[80]; \r\nvoid main()\r\n{\r\nchar *PText; \r\nTxt80 Txt=\"Ur2GReAt\"; \r\nint N=6;\r\nPText=Txt:\r\nwhile(N&gt;=3)\r\n{\r\nTxt[N]=isupper(Txt[N])? \r\ntolower(Txt[N]);\r\ntoupper(Txt[N]); \r\ncout&lt;&lt;PText&lt;&lt;endl;\r\nN--;\r\nPText++;\r\n}\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\nUr2GReat<br \/>\nr2GREat<br \/>\n2GrEat<br \/>\ngrEat<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 7:<br \/>\n<\/strong><\/span>In the following program, what will be the possible output(s) from the following options (i), (ii), (iii) and (iv)? Justify your answer. <strong>Delhi 2011C<\/strong><\/p>\n<pre>#include&lt;iostream.h&gt; \r\n#include&lt;stdlib.h&gt; \r\n#include&lt;string.h&gt; \r\n#include&lt;conio.h&gt; \r\nvoid main()\r\n{\r\nclrscr();\r\nchar *Text=\"1234\"; \r\nint L=strlen(Text);\r\nrandomize(); \r\nfor(int I=0;I&lt;L;I++)\r\n{\r\nint Start=random(I)+1; \r\nchar P=Text[Start]; \r\ncout&lt;&lt;P&lt;&lt;\":\";\r\n}\r\ngetch();\r\n}\r\n(i) 1:3:2:4: \r\n(ii) 2:2:3:2:\r\n(iii) 2:2:4:4: \r\n(iv) 2:2:2:3:<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>The possible output will be (ii) 2:2:3:2: and (iv) 2:2:2:3:<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 8:<br \/>\n<\/strong><\/span>Find the output of the following program : <strong>Delhi 2011<\/strong><\/p>\n<pre>#include&lt;iostream.h&gt;\r\n#include&lt;conio.h&gt; \r\nvoid main()\r\n{\r\nint Track[] = {10, 25, 30, 55},*Striker; \r\nStriker = Track;\r\nTrack[1] += 30;\r\ncout&lt;&lt;\"Striker\"&lt;&lt;*Striker&lt;&lt;endl; \r\n*Striker -= 10;\r\nStriker++;\r\ncout&lt;&lt;\"Next@\"&lt;&lt;*Striker&lt;&lt;endl;\r\nStriker += 2;\r\ncout&lt;&lt;\"Last@\"&lt;&lt;*Striker&lt;&lt;endl; \r\ncout&lt;&lt;\"Rest To\"&lt;&lt;*Striker[0]&lt;&lt;endl;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span> There is an error in last line, i.e. *Striker[0], so the program will not run. In case, if there is no subscript in Striker pointer, then the output would be<br \/>\nStriker10<br \/>\nNext@55<br \/>\nLast@55<br \/>\nRest To55<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 9:<br \/>\n<\/strong><\/span>Find the output of the following program: <strong>All India 2011<\/strong><\/p>\n<pre>#include&lt;iostream.h&gt; \r\n#include&lt;conio.h&gt;\r\nvoid main()\r\n{\r\nint *Queen, Moves[]={11, 22, 33,44};\r\nQueen = Moves;\r\nMoves[2] += 22; \r\ncout&lt;&lt;\"Queen @\"&lt;&lt;*Queen&lt;&lt;endl;\r\n*Queen -= 11;\r\nQueen += 2;\r\ncout&lt;&lt;\"Now@\"&lt;&lt;*Queen&lt;&lt;endl;\r\nQueen++;\r\ncout&lt;&lt;\"Finally@\"&lt;&lt;*Queen&lt;&lt;endl; \r\ncout&lt;&lt;\"New 0rigin@\"&lt;&lt;*Moves[0]&lt;&lt;endl;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>There is an error in last line, i.e. *Moves[0], so the program will not run. In case, if there is no subscript in Moves pointer, then the output would be<br \/>\nQueen @11<br \/>\nNow@55<br \/>\nFinally@44<br \/>\nNew 0rigin@0<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 10:<br \/>\n<\/strong><\/span>Find the output of the following program:<\/p>\n<pre>#include&lt;iostream.h&gt; \r\n#include&lt;conio.h&gt; \r\nvoid main()\r\n{\r\nint Numbers[]={2,4,8,10}; \r\nint *ptr = Numbers; \r\nfor(int c=0;c&lt;3;c++)\r\n{\r\ncout&lt;&lt;*ptr&lt;&lt;\"@\";\r\nptr++;\r\n}\r\ncout&lt;&lt;endl;\r\nfor(c=0:c&lt;4:c++)\r\n{\r\n(*ptr) *= 2;\r\n--ptr;\r\n}\r\nfor(c=1:c&lt;4;c++)\r\ncout&lt;&lt;Numbers[c]&lt;&lt;\"#\";\r\ncout&lt;&lt;endl;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\n2@4@8@<br \/>\n8#16#20#<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 11:<br \/>\n<\/strong><\/span>Find the output of the following program:<\/p>\n<pre>#include&lt;iostream.h&gt; \r\n#include&lt;conio.h&gt; \r\nvoid main()\r\n{\r\nint Array[]={4,6,10,12}; \r\nint *pointer = Array; \r\nfor(int i=1;i&lt;=3;i++)\r\n{\r\ncout&lt;&lt;*pointer&lt;&lt;\"#\";\r\npointer++;\r\n}\r\ncout&lt;&lt;endl; \r\nfor(i=1;i&lt;=4;i++)\r\n{\r\n(*pointer) *= 3;\r\n--pointer;\r\n}\r\nfor(i=l;i&lt;5;i++)\r\ncout&lt;&lt;Array[i-1]&lt;&lt;\"@\"; \r\ncout&lt;&lt;endl;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\n4#6#10#<br \/>\n12@18@30@36@<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 12:<br \/>\n<\/strong><\/span>Give the output of the following program segment. (Assume, all required header files are included in the program.)<\/p>\n<pre>void main()\r\n{\r\nint a=32,*X=&amp;a;\r\nchar ch=65, &amp;eco=ch; \r\neco+=a;\r\n*X+=ch;\r\ncout&lt;&lt;a&lt;&lt;','&lt;&lt;ch&lt;&lt;endl;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\n129,a<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 13:<br \/>\n<\/strong><\/span>Identify the syntax error(s), if any, in the following program. Also, give reason for errors.<\/p>\n<pre>void main()\r\n{\r\nconst int i=20;\r\nconst int *const ptr=&amp;i;\r\n(*ptr)++;\r\nint j=15;\r\nptr=&amp;j;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span> (*ptr)++ cannot modify a const object ptr-&amp;j cannot modify a const object.<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 14:<br \/>\n<\/strong><\/span>Give the output of the following program segment. (Assume, all required header files are included in the program.)<\/p>\n<pre>void main()\r\n{\r\nint array[] = {2,3,4,51}; \r\nint *arptr=array;\r\nint value=*arptr; \r\ncout&lt;&lt;va1ue&lt;&lt;'\\n'; \r\nvalue=*arptr++; \r\ncout&lt;&lt;value&lt;&lt;'\\n'; \r\nvalue=*arptr; \r\ncout&lt;&lt;value&lt;&lt;'\\n'; \r\nvalue=*++arptr; \r\ncout&lt;&lt;value&lt;&lt;'\\n'; \r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\n2<br \/>\n2<br \/>\n3<br \/>\n4<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 15:<br \/>\n<\/strong><\/span>Give the output of the following program segment. (Assume, all required header files are included in the program.)<\/p>\n<pre>void main()\r\n{\r\nchar *s=\"GOODLUCK\";\r\nfor(int x=strlen(s)-1;x&gt;=0;x--) \r\n{\r\nfor(int y=0;y&lt;=x;y++) \r\ncout&lt;&lt;s[y]; \r\ncout&lt;&lt;endl;\r\n}\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\nGOODLUCK<br \/>\nG00DLUC<br \/>\nG00DLU<br \/>\nGOODL<br \/>\nGOOD<br \/>\nGOO<br \/>\nGO<br \/>\nG<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 16:<br \/>\n<\/strong><\/span>Give the output of the following program segment. (Assume, all required header files are included in the program).<\/p>\n<pre>void main()\r\n{\r\nchar *NAME=\"a ProFile\"; \r\nfor(int x=0;x&lt;strlen(NAME);x++) \r\nif(islower(NAME[x])); \r\nelse\r\nif(isupper(NAME[x])) \r\nif(x%2!=0)\r\nNAME[x]=tolower(NAME[x-l] \r\nelse\r\nNAME[x]--;\r\ncout&lt;&lt;NAME&lt;&lt;endl;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\na Orooile<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 17:<br \/>\n<\/strong><\/span>Find and write the output of the following C++ program code: <strong>All India 2017<\/strong><br \/>\nNOTE Assume all required header files are already being included in the program.<\/p>\n<pre>void main()\r\n{\r\nint *Point, Score[]={100,95,150,75,65,120};\r\nPoint=Score; \r\nfor(int L=0;L&lt;6;L++)\r\n{\r\nif((*Point)%10==0) \r\n*Point \/= 2; \r\nelse\r\n*Point -= 2; \r\nif((*Point)%5==0) \r\n*Point \/= 5; \r\nPoint++;\r\n}\r\nfor(int L=5;L&gt;=0;L--)\r\ncout&lt;&lt;Score[L]&lt;&lt;\"*\";\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span> Given program will give error, i.e. Multiple declaration for \u2018L\u2019<br \/>\nIf we remove int from 2nd for loop then output will be:<br \/>\n12*63*73*15*93*10*<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 18:<br \/>\n<\/strong><\/span>Find the output of the following program: <strong>Delhi 2012C<\/strong><\/p>\n<pre>#include&lt;iostream.h&gt; \r\nvoid main() \r\n{\r\nint Points=300; \r\nint *Start=&amp;Points; \r\nint *End;\r\nEnd=new int;\r\n(*End)=Points-150:\r\nPoints+=100;\r\ncout&lt;&lt;Points&lt;&lt;\":\"&lt;&lt;*Start&lt;&lt;endl; \r\ncout&lt;&lt;*End&lt;&lt;endl;\r\nStart=End;\r\ncout&lt;&lt;Points&lt;&lt;\":\"&lt;&lt;*Start&lt;&lt;endl; \r\ncout&lt;&lt;*End&lt;&lt;endl;\r\nPoints-=100;\r\n*Start-=50;\r\ncout&lt;&lt;Points&lt;&lt;\":\"&lt;&lt;*Start&lt;&lt;endl; \r\ncout&lt;&lt;*End&lt;&lt;endl; \r\ndelete End;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be 400:400<br \/>\n150<br \/>\n400:150<br \/>\n150<br \/>\n300:100<br \/>\n100<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 19:<br \/>\n<\/strong><\/span>Find the output of the following program <strong>Delhi 2009<\/strong><\/p>\n<pre>#include&lt;iostream.h&gt; \r\n#include&lt;conio.h&gt; \r\nvoid main()\r\n{\r\nint X[]={10, 25, 30, 55, 110}; \r\nint *p=X; \r\nwhi1e(*p&lt;110)\r\n{\r\nif(*p%3!= 0)\r\n*p = *p+1; \r\nelse\r\n*p = *p+2; \r\np++:\r\n}\r\nfor(int 1=4;I&gt;=1;I--)\r\n{\r\ncout&lt;&lt;X[I]&lt;&lt;\"*\"; \r\nif(I%3 == 0) \r\ncout&lt;&lt;endl;\r\n} \r\ncout&lt;&lt;X[0]*3&lt;&lt;endl;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\n110*56*<br \/>\n32*26*33<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 20:<br \/>\n<\/strong><\/span>Find the output of the following program. <strong>Delhi (C) 2009<\/strong><\/p>\n<pre>#include&lt;iostream.h&gt; \r\n#include&lt;conio.h&gt; \r\nstruct score\r\n{\r\nint Year; \r\nfloat topper;\r\n};\r\nvoid Change(score *s, int x=20)\r\n{\r\ns-&gt;topper=(s-&gt;topper+25)-x; \r\ns-&gt;Year++;\r\n}\r\nvoid main()\r\n{\r\nscore Arr[]={{2007, 100},{2008, 951}};\r\nscore *Point=Arr;\r\nChange(Point, 50); \r\ncout&lt;&lt;Arr[0].Year&lt;&lt;\"#\"&lt;&lt;Arr[0].topper&lt;&lt;endl; \r\nChange(++Point);\r\ncout&lt;&lt;Point-&gt;Year&lt;&lt;\"#\"&lt;&lt;Point-&gt;topper&lt;&lt;endl;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\n2008#75<br \/>\n2009#100<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 21:<br \/>\n<\/strong><\/span>Find the output of the following program. <strong>All India 2009<\/strong><\/p>\n<pre>#include&lt;iostream.h&gt;\r\n#include&lt;conio.h&gt; \r\nvoid main()\r\n{\r\nint A[] = {10, 15, 20, 25. 30}; \r\nint *p = A; \r\nwhi1e(*p&lt;30)\r\n{\r\nif(*p%3!= 0)\r\n*p = *p+2;\r\nelse\r\n*p = *p+1;\r\nP++;\r\n}\r\nfor(int J=0;J&lt;=4;J++)\r\n{\r\ncout&lt;&lt;A[J]&lt;&lt;\"*\"; \r\nif(J*3 == 0) \r\ncout&lt;&lt;endl;\r\n}\r\ncout&lt;&lt;A[4]*3&lt;&lt;endl;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\n12*<br \/>\n16*22*27*<br \/>\n30*90<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 22:<br \/>\n<\/strong><\/span>What will be the output of the following program?<\/p>\n<pre>#include&lt;iostream.h&gt; \r\n#include&lt;ctype.h&gt;\r\n#include&lt;conio.h&gt;\r\n#include&lt;string.h&gt; \r\nvoid ChangeString(char Text[],int SCounter)\r\n{\r\nchar *Ptr = Text;\r\nint Length = strlen(Text); \r\nfor(;Counter&lt;Length-2;Counter+=2,Ptr++)\r\n{\r\n*(Ptr+Counter)=toupper(*(Ptr+Counter));\r\nvoid main()\r\n{\r\nint Position=0;\r\nchar Message[]=\"Pointers Fun\"; \r\nChangeString(Message, Position); \r\ncout&lt;&lt;Message&lt;&lt;\"@\"&lt;&lt;Position;\r\n}<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\nPoiNteRs Fun@10<\/p>\n<p><span style=\"color: #eb4924\"><strong>Question 23:<br \/>\n<\/strong><\/span>What will be the output of the following program?<\/p>\n<pre>#include&lt;iostream.h&gt;\r\n#include&lt;ctype.h&gt;\r\n#include&lt;conio.h&gt;\r\n#include&lt;string.h&gt; \r\nvoid NewtextCchar String[],int &amp;Position)\r\n{\r\nchar *Pointer=String;\r\nint Length=strlen(String);\r\nfor(;Position&lt;Length-2;Position+=2,Pointer++)\r\n{\r\n*(Pointer+Position)=toupper(*(Pointer+Position));\r\n}\r\n}\r\nvoid main()\r\n{\r\nclrscr();\r\nint Location=0;\r\nchar Message[]=\"Dynamic Act\";\r\nNewtext(Message, Location);\r\ncout&lt;&lt;Message&lt;&lt;\"#\"&lt;&lt;Location;\r\n}\r\n<\/pre>\n<p><span style=\"color: #eb4924\"><strong><span style=\"color: #008000\">\u0410nswer:<br \/>\n<\/span><\/strong><\/span>Output of the given program will be<br \/>\nDynAmiC ACt#10<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Important Questions for Class 12 Computer Science (C++) \u2013 Pointers Previous years Examination Questions 2 Marks Questions Question 1: Obtain [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"Get Important Questions for Class 12 Computer Science (C++) \u2013 Pointers to infinity learn","custom_permalink":"study-material\/important-questions\/class-12\/computer-science-c-pointers\/"},"categories":[93,21],"tags":[],"table_tags":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Important Questions for Class 12 Computer Science (C++) \u2013 Pointers - Infinity Learn by Sri Chaitanya<\/title>\n<meta name=\"description\" content=\"Get Important Questions for Class 12 Computer Science (C++) \u2013 Pointers to infinity learn\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Important Questions for Class 12 Computer Science (C++) \u2013 Pointers - Infinity Learn by Sri Chaitanya\" \/>\n<meta property=\"og:description\" content=\"Get Important Questions for Class 12 Computer Science (C++) \u2013 Pointers to infinity learn\" \/>\n<meta property=\"og:url\" content=\"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/\" \/>\n<meta property=\"og:site_name\" content=\"Infinity Learn by Sri Chaitanya\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/InfinityLearn.SriChaitanya\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-01-25T12:22:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/infinitylearn.com\/surge\/wp-content\/uploads\/2025\/04\/infinitylearn.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1008\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InfinityLearn_\" \/>\n<meta name=\"twitter:site\" content=\"@InfinityLearn_\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prasad Gupta\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Important Questions for Class 12 Computer Science (C++) \u2013 Pointers - Infinity Learn by Sri Chaitanya","description":"Get Important Questions for Class 12 Computer Science (C++) \u2013 Pointers to infinity learn","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/","og_locale":"en_US","og_type":"article","og_title":"Important Questions for Class 12 Computer Science (C++) \u2013 Pointers - Infinity Learn by Sri Chaitanya","og_description":"Get Important Questions for Class 12 Computer Science (C++) \u2013 Pointers to infinity learn","og_url":"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/","og_site_name":"Infinity Learn by Sri Chaitanya","article_publisher":"https:\/\/www.facebook.com\/InfinityLearn.SriChaitanya\/","article_published_time":"2022-01-25T12:22:35+00:00","og_image":[{"width":1920,"height":1008,"url":"https:\/\/infinitylearn.com\/surge\/wp-content\/uploads\/2025\/04\/infinitylearn.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_creator":"@InfinityLearn_","twitter_site":"@InfinityLearn_","twitter_misc":{"Written by":"Prasad Gupta","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/infinitylearn.com\/surge\/#organization","name":"Infinity Learn","url":"https:\/\/infinitylearn.com\/surge\/","sameAs":["https:\/\/www.facebook.com\/InfinityLearn.SriChaitanya\/","https:\/\/www.instagram.com\/infinitylearn_by_srichaitanya\/","https:\/\/www.linkedin.com\/company\/infinity-learn-by-sri-chaitanya\/","https:\/\/www.youtube.com\/c\/InfinityLearnEdu","https:\/\/twitter.com\/InfinityLearn_"],"logo":{"@type":"ImageObject","@id":"https:\/\/infinitylearn.com\/surge\/#logo","inLanguage":"en-US","url":"","contentUrl":"","caption":"Infinity Learn"},"image":{"@id":"https:\/\/infinitylearn.com\/surge\/#logo"}},{"@type":"WebSite","@id":"https:\/\/infinitylearn.com\/surge\/#website","url":"https:\/\/infinitylearn.com\/surge\/","name":"Infinity Learn by Sri Chaitanya","description":"Surge","publisher":{"@id":"https:\/\/infinitylearn.com\/surge\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/infinitylearn.com\/surge\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/#webpage","url":"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/","name":"Important Questions for Class 12 Computer Science (C++) \u2013 Pointers - Infinity Learn by Sri Chaitanya","isPartOf":{"@id":"https:\/\/infinitylearn.com\/surge\/#website"},"datePublished":"2022-01-25T12:22:35+00:00","dateModified":"2022-01-25T12:22:35+00:00","description":"Get Important Questions for Class 12 Computer Science (C++) \u2013 Pointers to infinity learn","breadcrumb":{"@id":"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/infinitylearn.com\/surge\/"},{"@type":"ListItem","position":2,"name":"Important Questions for Class 12 Computer Science (C++) \u2013 Pointers"}]},{"@type":"Article","@id":"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/#article","isPartOf":{"@id":"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/#webpage"},"author":{"@id":"https:\/\/infinitylearn.com\/surge\/#\/schema\/person\/143c89c9c2f5e56ed91f96dde47b0b05"},"headline":"Important Questions for Class 12 Computer Science (C++) \u2013 Pointers","datePublished":"2022-01-25T12:22:35+00:00","dateModified":"2022-01-25T12:22:35+00:00","mainEntityOfPage":{"@id":"https:\/\/infinitylearn.com\/surge\/study-material\/important-questions\/class-12\/computer-science-c-pointers\/#webpage"},"wordCount":725,"publisher":{"@id":"https:\/\/infinitylearn.com\/surge\/#organization"},"articleSection":["Important Questions","Study Materials"],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/infinitylearn.com\/surge\/#\/schema\/person\/143c89c9c2f5e56ed91f96dde47b0b05","name":"Prasad Gupta","image":{"@type":"ImageObject","@id":"https:\/\/infinitylearn.com\/surge\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/200104b443e586c76c46cadc113d931c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/200104b443e586c76c46cadc113d931c?s=96&d=mm&r=g","caption":"Prasad Gupta"},"url":"https:\/\/infinitylearn.com\/surge\/author\/prasad\/"}]}},"_links":{"self":[{"href":"https:\/\/infinitylearn.com\/surge\/wp-json\/wp\/v2\/posts\/25502"}],"collection":[{"href":"https:\/\/infinitylearn.com\/surge\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infinitylearn.com\/surge\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infinitylearn.com\/surge\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/infinitylearn.com\/surge\/wp-json\/wp\/v2\/comments?post=25502"}],"version-history":[{"count":0,"href":"https:\/\/infinitylearn.com\/surge\/wp-json\/wp\/v2\/posts\/25502\/revisions"}],"wp:attachment":[{"href":"https:\/\/infinitylearn.com\/surge\/wp-json\/wp\/v2\/media?parent=25502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infinitylearn.com\/surge\/wp-json\/wp\/v2\/categories?post=25502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infinitylearn.com\/surge\/wp-json\/wp\/v2\/tags?post=25502"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/infinitylearn.com\/surge\/wp-json\/wp\/v2\/table_tags?post=25502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}