0% found this document useful (0 votes)
9 views3 pages

CBSE Computer Science Sample Paper

This document contains sample questions for the CBSE Computer Science exam. It includes questions about: 1. The difference between local and global variables in C++ and an example code to illustrate each. 2. The header files required to run a given C++ code sample and rewriting the code after removing syntactical errors. 3. Writing a C++ function to transfer arrays into another array with alternating elements from each source array and calculating the memory location of an element in a 2D array.

Uploaded by

api-139761950
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

CBSE Computer Science Sample Paper

This document contains sample questions for the CBSE Computer Science exam. It includes questions about: 1. The difference between local and global variables in C++ and an example code to illustrate each. 2. The header files required to run a given C++ code sample and rewriting the code after removing syntactical errors. 3. Writing a C++ function to transfer arrays into another array with alternating elements from each source array and calculating the memory location of an element in a 2D array.

Uploaded by

api-139761950
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CBSE Computer Science Sample Papers

CBSE Computer Science Sample Papers


1. (a) What is the difference between Local Variable and Global Variable ? Also, give suitable C++ code to illustrate both. 2 (b) Write the names of the header files, which is/are essentially required to run/execute the following C++ code: 1 void main () { char C, String [] = Excellence Overload; for (int I=0; String [I] ! = \0;I++} if (String [I] == ) cout<<endl; else { C=toupper(String [I]); cout<<C; } } Know More About :- Geography ICSE Sample Paper

[Link]

Page : 1/3

(c) Rewrite the following program after removing the syntactical errors (if any). Underline each correction. 2 #include [iostream.h] typedef char Text (80); void main () { Text T=Indian; int Count=strlen(T); cout<<T<<has<<Count<<characters<<endl; } 3. (a) Write a Get1From2( ) function in C++ to transfer the content from two arrays FIRST[ ] and SECOND[ ] to array ALL[ ]. The even places (0, 2, 4,) of arrayALL[] should get the content from the array FIRST[ ] and odd places (1,3,5,) of the array ALL [ ]should get the content from the array SECOND[ ] . 3 Example: If the FIRST[ ] array contains 30, 60, 90 And the SECOND[ ] array contains 10, 50, 80 The ALL[ ] array should contain 30, 10, 60, 50, 90, 80 (b) An array P[20] [50] is stored in the memory along the column with each of its Element occupying 4 bytes, find out the location of P[15] [10], if P[0][0] is stored at 5200. 3

Read More About :- History ICSE Sample Paper

[Link]

Page : 2/3

ThankYou

[Link]

You might also like