Important Questions

CBSE Guess > Papers > Important Questions > Class XII > 2010 > Computer Science > Computer Science By Naveen Gupta

CBSE CLASS XII

Q. 1. (a) What is recursive function? Specify the conditions when you can not create recursive function?

(b) Name the Header file(s) that shall be needed for successful compilation of the following C++ code?

void main()
{
char st[20];
cin.getline(st,15);
if(islower(st[0])
cout<<”Starts with alphabet”;
else
cout<<strlen(st);

}

(c) Rewrite the following program after removing syntactical error(s) if any. Underline each correction.

#include<iostream.h>
#define SIZE =10
VOID Main()
{
int a[SIZE]={1,2,3,4,5};
float x=2;
SIZE=5;
for(int i=0;i<SIZE;i++)
cout<<a[i]%x;
}

(d) Find the output of the following program :

(i) #include<iostream.h>
#include<string.h>
struct Student
{
int rno;
char name[20];
};
void main()
{
student a[2]={1,”Anil”,}{2,”Sunil”}};
for(int i=0;i<2;i++)
{
cout<<”\n Rno”<<a[i].rno;
cout<<”\n Name “;
for(int j=0;j<strlen(a[i].name);j++)
cout<<a[i].name[i]<<” “;
}
}

(ii) #include<iostream.h> 3
#include<conio.h>
int main()
{
char string[]=”Pointers and strings”;
cout<<*(&string[2])<<endl;
cout.write(string+5,15).put(‘\n’);
cout<<*(string+3)<<”\n”;
return 0;
}

Paper By Mr. Naveen Gupta
Email Id : [email protected]