CS201 Finalterm Current Paper 2013 File 5 Shared by Nadia Kousar


My today cs201 final term paper
02-03-2013
(Nadia Kousar )
MCQ’s new thy sab koi 4,5 past paper mein sy thy subjective paper ye tha
Q: 1        In C++ language how would you identify whether a declared variable is a “reference variable “ or an “address variable” ?
Q: 2        How can we initialize an object which is declared as constant data member in another class ?
Q:3         write general syntax of two way friendship between the two classes (class1  and class2) ?
Q:4         Assume if p is a pointer then what will happen if  each of the below statement is executed ?
  • Delete  (p)
  • Delete []p
Q:5         what is the difference between “endl” and “ \n” ?
Q:6         write the output of the program
#include <iostream.h>
Main ( )
{
Char *name [] = {“Ali” , “Ahmad” , “Riaz”};
int x;
int y;
x = sizeof (name);
y = sizeof (*name);
cout x endl y ;
return 0 ;
}
Q:7         write the output of the following code
#include < string.h >
#include < iostream.h >
int main ( )
{
Char str [ ] = “ This is a line “ ;
Char*p ;
P = strchr ( str , ‘s’ ) ;
While ( p! = NULL ) {
Cout “ found at \n “ p – str + 1 ;
P = strchr ( p + , ‘s’ ) ;
return 0 ;
}
Q:8         write a program which defines a user-defined manipulator named Octal. This manipulator should convert and display the decimal number into Octal form. In the main function, you have to take a decimal number as an input from the user and hen by using the user defined manipulator display the number in Octal form.
Q:9         write a program that defines a Template function named Square ( ) which finds the square of a number and then return it. Define one variable of type float in main function and call square function on that.
Output should be as given below
Enter a float value to its square: 12.3                                       
Square of float number is: 151.29
3 question yaad nai aa rhy 

No comments:

Post a Comment