Select The Diploma in Information Technology (DIT) Papers

Computer Network 2nd Term 2021
Computer Network 2nd Term 2022
E- Commerce and Web Technology 1st Term 2019
Operating System 1st Term 2019
Computer Network 1st Term 2019
Computer Programming C/C++ 2019
Introduction to Data Base 2019
MS Access 1st Term 2019
Office Automation 1st Term 2019
Ms-Access DIT Part 2nd Exam 2013 2nd Term
Introduction to Data Base DIT Part 2nd Exam 2014 2nd term
Ms-Access DIT Part 2nd 1st Term examination 2013
Ms- Access DIT Part 2nd 1st Term Exam 2014
Introduction to Data Base DIT Part 2nd 1st Term Exam 2014
E-Commerce & Web Technology DIT part second 2nd Term 2013
E-Commerce & Web Technology DIT part second 1st Term 2013
E-Commerce & Web Technology DIT part second 2014
Operating System DIT Part First 2013
Operating System DIT Part First 2012
Solved exam papers of C/C++ DIT Part First Exam 1st Term 2013
Solved exam papers of C/C++ DIT Part First Exam 1st Term 2012
Solved exam papers of C/C++ DIT Part First Exam 2nd Term 2013
DIT Part 2nd Solved Exam paper of Graphic Designing
Solved exam papers of IT DIT part 1st Exam 2103
DIT Exam paper of E-Commerce and Web Designing 2014
DIT Exam paper of Data Base 2014
DIT Exam paper of MS Access 2014
DIT Exam paper of Graphic Design 2014
DIT(Part 1st) Solved Exam Paper 1st Term Exam 2012 IT
DIT(Part 1st) Solved Exam Paper 1st Term Exam 2012 IT
Exam Paper of Office Automation for DIT Part First 2013
Exam paper of Computer Networks for DIT Part First 2013
Exam paper of ICT DIT Part First 2013
Exam paper of C/C++ language DIT Part First 2013
Exam paper of Operating System DIT Part First 2013

Solved Exam Paper Of Computer Programming C/C++

DIT part 1st (1st Term Exam 2012)

Time Allowed: 3 Hours Max Marks=100

Note : Attempt any five question. All question carry equal marks.

Q1. Briefly explain The difference between C and C++? (10)

Answer:
C is a general-purpose computer programming language. Although C was designed for implementing system software, it is also widely used for developing portable application software.
C is one of the most popular programming languages. C++ is originally began as an extension to C but have some more feature which is not available in C language.
Following are the some major differences between c and C++:
C is Procedural Language. where C++ is non Procedural. C++ is Object oriented Language.
The concept of polymorphism is used in C++ where In C, Polymorphism is not possible.
In simple C language Operator overloading is not available on the other hand Operator overloading is one of the greatest Feature of C++.
In C multiple declaration of global variables are allowed but in C++ there is no multiple declaration of global variables are not allowed.
In C scanf() Function used for Input and printf() Function used for output where In C++ we use Cin>> as input and Cout<< as output function.
In C language we can call main() Function through other Functions but in C++ this is not possible. Inheritance is not possible in C but possible in C++.
In C Exception Handling is not present on the other hand in C++ Exception Handling is possible.

Q2. Define constant and Its types? (10)

Answer:
Constants:
A constant value is the one, which does not change during the execution of a program. C supports several types of constants.
1. Integer Constants
2. Real Constants
3. Single Character Constants
4. String Constants
1) Integer Constants
An integer constant is a sequence of digits. There are 3 types of integers namely decimal integer, octal integers and hexadecimal integer.
Decimal Integers: consists of a set of digits 0 to 9 preceded by an optional + or - sign. Spaces, commas and non-digit characters are not permitted between digits. Example Decimal integer constants are
123 , -31 , 0 , 562321 , + 78
2) Real Constants
Real Constants consists of a fractional part in their representation. Integer constants are inadequate to represent quantities that vary continuously. These quantities are represented by numbers containing fractional parts like 26.082. Example of real constants are
0.0026 , -0.97 , 435.29 , +487.0
Real Numbers can also be represented by exponential notation. The general form for exponential notation is mantissa exponent. The mantissa is either a real number expressed in decimal notation or an integer. The exponent is an integer number with an optional plus or minus sign.
3) Single Character Constants:
Single Character constant represent a single character which is enclosed in a pair of quotation symbols. Example for character constants are

 '5' , 'x' , ';' , ' ' 

All character constants have an equivalent integer value which are called ASCII Values.
4) String Constants
A string constant is a set of characters enclosed in double quotation marks. The characters in a string constant sequence may be a alphabet, number, special character and blank space. Example of string constants are
"VISHAL" , "1234" , "God Bless" , "!.....?" 

Q3.Define and explain the reserved word? give at least three example and explain each one?

Answer:
Reserved Word:
The reserved some time also called Keyword are the word, which have special meaning for compiler. These meaning are predefined to compiler. There are 38 keywords in C Language. For example auto, double, int , struct, break etc
Break reserved Word:
When we want to jump out form the loop with out waiting to get back to test condition then we use Break Keyword. for example

n=10;
while (n<=50)
{
break;
printf("Next")
}

In above example This loop print nothing because break keyword terminate the loop with executing the statements next in the body of loop.
continue reserved word:
Passes control to the beginning of the loop with executing the other statment after this continue keyword.
For example,
for (i = 0; i < 20; i++)
{
if (i == 5)
continue;
printf("%d", i);}
}

in this example all the number form 1 to 19 printed but 5 will not print
Int reserved word: The int reserved word is used to declare the integer variable in c language. For this purpose we type reserved word int followed by variable name and its value. where value is optional.
For example
 int a, b, c;  // whare a and b and c are variable name

or
int a=10;

Q4. Write down a c++ program which covert Fahrenheit to Celsius scale? (10)


Answer:
#include
#include
void main(void)
{
floatf,c;
clrscr();
cout<<"enter temperature in F :";
cin>>f;
c=(f-32)*5/9;
cout<<"temperature ic c is "< getch();
}

Q5. What is IF Statment and the term IF and Nested IF with example? (10)

Answer:
IF Statement
if statement is decision making statement or decision control statement in this statement we give a condition after using " IF " key word. If the condition is " True " then a statement or set of statements in the body of " IF " structure are executed and if the condition is "False? then nothing will be do and control is transfer to next statement according to sequences.
We say that if statement allows you to execute specific parts of a program if certain conditions are met (if condition is true) .
If structure contain three main parts. The first is the keyword " if ". The second is an expression enclosed in parentheses (Condition). The third is the block of code (which is written in parentheses) that you want to run if the condition met to given condition.
Example

main( )
{
int n=7;
if(n>0)
printf("this is +ve number");
}

Nested IF Statement
If an IF statement is tart in the body of other IF statement then this is called nested if statement.
it is used when we have multiple conditions to check and when any if condition contains another if statement then that is called "nested if ".

Example
Main( )
{
int n ;
printf( "Enter a number" ) ;
scanf (? %d ? , &n ) ;
if(n== 1)
printf( ?You Enter One? ) ;
else
if(n==2)
printf( ?You Enter Two? ) ;
else
if(n==3)
printf( ?You Enter Three? ) ;
else
printf( ? You enter other the one , two or three " ) ;
}
getch( ); 

in above example we see that if we enter 1(one) form keyboard then message appear that "You enter One" other wise condition is again tested end the result is prepared .

Q6. down a do while loop program in which quotient and Remainder of an arithmetic division operations shows?

Answer:

#include
#include
void main(void)
{
intq,r;
clrscr();
cout<<"enter a decimal number :";
cin>>q;
while(q>=2)
{
r=q%2;
q=q/2;
cout << "the quotient is =" << q << and reminder is ="< < r < < endl ; }
getch();
}

Q7. Define the function and also pass the constant argumant in function?


Answer:
function:
A function is a group of statements which are write toperform a specific task when you need. Every C program is collection of diffirent function and has at least one function, which is main(), and all the most trivial programs can define additional functions.
In c function used in three steps:
Declaration of function:
The declaration of function tells the compiler about a function's name, return type, and parameters.
we declared the function in following way:
return type function name( parameter list );
For example
int max(int num1, int num2);
Function Definition:
A function definition is the actual body of the function which contain some statement which are execute when we call this function.
Syntax;
return_type function_name( parameter list )
{
body of the function
}

Where return type is the data type of the value the function returns.
The function name is actual name of the function. When we call this function then use this name .
Parameters is are the values which are passed to a function for processing.
The function body contains a collection of statements that define what the function does.
(b)

Example of Passing the Constant argument in Function:
calling function using constant argument:
result=max(22,56,90)
Function definition:

int max( int n1, n2 ,n3) 
{
int n1,n2,n3, maxval;

if (n1 > n2)
maxval = n1;
else
maxval = n2;

return maxval; 
}

Q8. . Write a c++ program which demonstrates the cube root of a number by using for loop and multiple values?

Answer:

#include
#include
void main(void)
{
inti,cube,number;
clrscr();
cout<<"enter a number :";
cin>>number;
for(i=0;i<5000;i++)
{
cube=i*i*i;
if(cube==number)
cout<<"the closest cube root is= "<number)
break;
}
getch();
}





View and Download More Papers !

Exam paper of Operating System DIT Part First 2013

Exam paper of C/C++ language DIT Part First 2013

Exam paper of ICT DIT Part First 2013

Exam paper of Computer Networks for DIT Part First 2013

Exam Paper of Office Automation for DIT Part First 2013

DIT(Part 1st) Solved Exam Paper 1st Term Exam 2012 IT

DIT(Part 1st) Solved Exam Paper 1st Term Exam 2012 IT

DIT Exam paper of Graphic Design 2014

DIT Exam paper of MS Access 2014

DIT Exam paper of Data Base 2014

DIT Exam paper of E-Commerce and Web Designing 2014

Solved exam papers of IT DIT part 1st Exam 2103

DIT Part 2nd Solved Exam paper of Graphic Designing

Solved exam papers of C/C++ DIT Part First Exam 2nd Term 2013

Solved exam papers of C/C++ DIT Part First Exam 1st Term 2012

Solved exam papers of C/C++ DIT Part First Exam 1st Term 2013

Operating System DIT Part First 2012

Operating System DIT Part First 2013

E-Commerce & Web Technology DIT part second 2014

E-Commerce & Web Technology DIT part second 1st Term 2013

E-Commerce & Web Technology DIT part second 2nd Term 2013

Introduction to Data Base DIT Part 2nd 1st Term Exam 2014

Ms- Access DIT Part 2nd 1st Term Exam 2014

Ms-Access DIT Part 2nd 1st Term examination 2013

Introduction to Data Base DIT Part 2nd Exam 2014 2nd term

Ms-Access DIT Part 2nd Exam 2013 2nd Term

Office Automation 1st Term 2019

MS Access 1st Term 2019

Introduction to Data Base 2019

Computer Programming C/C++ 2019

Computer Network 1st Term 2019

Operating System 1st Term 2019

E- Commerce and Web Technology 1st Term 2019

Computer Network 2nd Term 2022

Computer Network 2nd Term 2021