The document provides examples to illustrate the differences between various C++ concepts:
1) It compares call by value and call by reference, showing that call by reference updates the original variable unlike call by value.
2) It contrasts automatic type conversion and type casting, demonstrating that automatic conversion happens implicitly while type casting is explicit.
3) It distinguishes between local and global variables by defining local variables' scope as within a function, while global variables can be accessed anywhere.
Programs are complete in best of my knowledge with zero compilation error in IDE Bloodshed Dev-C++. These can be easily portable to any versions of Visual Studio or Qt. If you need any guidance please let me know via comments and Always Enjoy Programming.
1z0 851 exam-java standard edition 6 programmer certified professionalIsabella789
Â
Guaranteed success with updated troytec dumps for 1Z0-851 Exam-Java Standard Edition 6 Programmer Certified Professional visit@ https://www.troytec.com/1Z0-851-exams.html
Os benefĂcios do Ăłleo de coco vĂŁo muito alĂŠm de uma dieta
para emagrecer. Ele tambĂŠm auxilia a dieta de atletas. Ăleo
de coco ĂŠ fonte de energia facilmente disponĂvel, ocorre a
mobilização do estoque de gordura corporal, aumento do
metabolismo, alĂŠm de poupar a proteĂna muscular.
Programs are complete in best of my knowledge with zero compilation error in IDE Bloodshed Dev-C++. These can be easily portable to any versions of Visual Studio or Qt. If you need any guidance please let me know via comments and Always Enjoy Programming.
1z0 851 exam-java standard edition 6 programmer certified professionalIsabella789
Â
Guaranteed success with updated troytec dumps for 1Z0-851 Exam-Java Standard Edition 6 Programmer Certified Professional visit@ https://www.troytec.com/1Z0-851-exams.html
Os benefĂcios do Ăłleo de coco vĂŁo muito alĂŠm de uma dieta
para emagrecer. Ele tambĂŠm auxilia a dieta de atletas. Ăleo
de coco ĂŠ fonte de energia facilmente disponĂvel, ocorre a
mobilização do estoque de gordura corporal, aumento do
metabolismo, alĂŠm de poupar a proteĂna muscular.
Two-Roll Mixing Mills have been in existence since the time mixing of rubber started for various applications. It is still a sacred machinery for the rubber processors. This feature is a true reflection of what this popular rubber machinery has morphed
Esame corso garden design 50 ore per corsi verona.
Progetto completo di parte botanica e di sezioni di progettazione con rendering.
#corsiverona #progettazionegiardini #corsogardendesign.
While doing programming in any programming language, you need to use various variables to store various information. Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory.
You may like to store information of various data types like character, wide character, integer, floating point, double floating point, boolean etc. Based on the data type of a variable, the operating system allocates memory and decides what can be stored in the reserved memory.
Esta nueva serie examina como Dios es el dueĂąo del 100% no solamente de mi dinero, de mis hijos, esposo, casa, propiedades, negocio, carro, salud, etc. Dar nuestras ofrenda y diezmos es en agradecimiento y obediencia a Dios. Pero tambiĂŠn deberĂamos de dar con gozo.
www.ebenezermd.org
Functions, classes, and objects are fundamental concepts in object-oriented programming. Here's a brief explanation of each:
Functions:
Functions are blocks of code that perform specific tasks or computations.
They encapsulate a set of instructions and can take parameters (input) and return values (output).
Functions are reusable, promoting code modularity and maintainability.
Classes:
Classes are blueprints or templates for creating objects.
They define the structure and behavior of objects by specifying attributes (data members) and methods (functions) that the objects will have.
Classes serve as a model for creating multiple instances (objects) with similar characteristics.
Objects:
Objects are instances of classes.
They are concrete representations of the class's blueprint, with their own unique data values and the ability to perform actions using the methods defined in the class.
Objects are used to model and manipulate real-world entities in code.
In summary, functions are used to define specific tasks or operations, classes serve as templates for creating objects with shared attributes and behaviors, and objects are instances of classes that represent real-world entities and can interact with their environment. These concepts are central to object-oriented programming and software development.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
Â
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
Â
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasnât one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Â
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...NelTorrente
Â
In this research, it concludes that while the readiness of teachers in Caloocan City to implement the MATATAG Curriculum is generally positive, targeted efforts in professional development, resource distribution, support networks, and comprehensive preparation can address the existing gaps and ensure successful curriculum implementation.
How to Add Chatter in the odoo 17 ERP ModuleCeline George
Â
In Odoo, the chatter is like a chat tool that helps you work together on records. You can leave notes and track things, making it easier to talk with your team and partners. Inside chatter, all communication history, activity, and changes will be displayed.
Delivering Micro-Credentials in Technical and Vocational Education and TrainingAG2 Design
Â
Explore how micro-credentials are transforming Technical and Vocational Education and Training (TVET) with this comprehensive slide deck. Discover what micro-credentials are, their importance in TVET, the advantages they offer, and the insights from industry experts. Additionally, learn about the top software applications available for creating and managing micro-credentials. This presentation also includes valuable resources and a discussion on the future of these specialised certifications.
For more detailed information on delivering micro-credentials in TVET, visit this https://tvettrainer.com/delivering-micro-credentials-in-tvet/
2. 1
1. (a) Name the header file to
which the following belong
1
(i) abs( )
(ii) isupper( ) 2006
Delhi
1. (a) (i) math.h (ii) ctype.h
3. 2
1. (a) Name the header file to which
the following belong :
1
(i) pow()
(ii) random() 2006
OD
1. (a) (i) math.h / complex.h (ii)
4. 3
1. (a) Differentiate between a Logical
Error and Syntax Error. Also give
suitable examples of each in C++. 2
2007 Delhi
1. (a) Logical Error:
Error occurred due to incorrect logic applied by the
programmer.
Syntax Error:
Error occurred due to not following the proper
grammar/syntax of the language
OR
Error occurred due to violating rules of the
programming language
5. Example:
//Program to find area and perimeter of rectangle
void main()
{
int A,B,AR,P;
A=10;
B=20;
AR=2*(A*B); //Logical Error â Wrong Formula
P=2*(A+B);
cout<<A<<P>>endl; //Syntax Error â Use of >> with cout
}
(½ Mark for each correct explanation of Logical Error and Syntax
Error)
(½ Mark for each correct example of Logical Error and Syntax
Error)
OR
(Full 2 Marks for correct examples demonstrating the difference
between Logical Error and Syntax Error)
Note: Only 1 Mark to be awarded if Explanation is given without
supporting example.
6. 4
1. (a) Differentiate between a Run Time
Error and Syntax Error. Also give suitable
examples of each in C++. 2
2007 OD
1. (a) Run Time Error : Error occurring in a program during its
execution. Program execution halts when such an error is
encountered.
Example:
int A,B,C;
cin>>A>>B;
C=A/B;//Runtime error if value of B is zero.
Syntax Error: Error occurred due to wrong syntax of language
detected by the compiler during compilation.
Example:
cout>>âA C++ Programâ;
(½ Mark for each correct explanation of Runtime Error and Syntax
Error)
7. (½ Mark for each correct example of Runtime Error
and Syntax Error)
OR
(Full 2 Marks for correct examples demonstrating the
difference
between Runtime Error and Syntax Error)
OR
(Only 1 Mark to be awarded if Explanation with out
supporting
examples)
8. 5
1. (a) What is the difference between #define
and const? Explain with suitable example. 2
2008 D
#define: It is a pre-processor directive in C++ for creating a Macro.
Example:
#define sqr(i) i*i
const: It is an Access Modifier in C++ that assigns a constant (non
modifiable) value to a variable. Any attempt in modifying the value
assigned to such a variable is reported as an error by the compiler.
Example:
const float Pi = 3.14;
(½ Mark for each correct explanation of #define and const)
(½ Mark for each correct example of #define and const)
OR
(Full 2 Marks for correct examples demonstrating the difference
between #define and const)
OR
(Only 1 Mark to be awarded if Explanation without supporting
examples)
9. 6
(a) What is the purpose of using a typedef command in C++.
Explain with suitable example. 2
2008 OD
Ans: Typedef:
This keyword allows creating synonyms or aliases for
previously defined data types The general form of typedef is
typedef old_name new_name;
OR
typedef is used for renaming a data type.
Example:
typedef char STR [80]; OR typedef signed char SMALLNUM;
OR typedef float REAL; OR typedef long int BIGNUM;
OR typedef int MAT[2][3] ;
(1 Mark for definition of typedef)
(1 Mark for example of typedef)
OR
(Full 2 Marks for an example with an appropriate explanation)
10. 7
1. (a) What is the difference between call by
value and call by reference? Give an
example in C++ to illustrate both. 2
2009 D
Call by value is used to create a temporary copy of
the data coming from the actual parameter into the
formal parameter. The changes done in the function
in formal parameter are not reflected back in the
calling environment. It does not use â&â sign.
Call by reference is used to share the same memory
location for actual and formal parameters and so
changes done in the function are reflected back in
the calling environment. It uses â&â sign.
11. void Compute(int A, int &B)
{
A++;
B++;
cout<<âIn the functionâ<<endl;
cout<<âA=â<<A<<â&â<<âB=â<<B<<endl;
}
void main ()
{
int I=50,J=25;
cout<<âBefore function call â<<endl;
cout<<âI=â<<I<<â&â<<âJ=â<<J <<endl;
Compute (I,J) ;
cout<<âAfter function call â<<endl;
cout<<I=â<<I<<â&â<<âJ=â<<J <<endl;
}
12. OUTPUT
Before function call
I=50&J=25
In the function
A=51&B=26
After function call
I=50&J=26
(½ Mark for each correct explanation of Call by Value and Call by
Reference)
(½ Mark for each correct example of Call by Value and Call by
Reference)
OR
(Full 2 Marks for correct examples demonstrating the difference
between
Call by Value and Call by Reference)
OR
(Only 1 Mark to be awarded if Explanation without supporting
examples)
Note: Output is optional
13. 8
1. (a) What is the difference between
Actual Parameter and Formal Parameter?
Give an example in C++ to illustrate both
types of parameters.
2
2009 ODA parameter used in the function call is known as Actual
Parameter. It is used to send the data to function. A
parameter used in the function definition is known as
Formal Parameter, It is used to accept the data from actual
parameter.
void Seventimes(int A)//A is formal parameter
{
cout<<7*A;
}
14. void main ()
{
int P=6;
Seventimes(P);//p is actual parameter
}
(½ Mark for each correct explanation of Actual
Parameter and Formal Parameter)
(½ Mark for each correct example of Actual Parameter
and Formal Parameter)
OR
(Full 2 Marks for correct examples demonstrating the
difference between Actual Parameter and Formal
Parameter)
OR
(Only 1 Mark to be awarded for Explanation given
without supporting examples)
15. 9
1. (a) What is the difference between automatic
type conversion and type casting? Also, give a
suitable C++ code to illustrate both. 2
2010 D
Automatic Type Conversion: it is an implicit process of conversion
of a data from one type to another. For example
int N = 65;
char C = N; // Automatic type conversion
cout<<C;
OUTPUT:
A
Type Casting: It is an explicit process of conversion of a data from
one type to another. For example
16. int A=1, B=2;
float C = (float)A/B; //Type Casting
cout<<C;
OUTPUT:
0.5
(½ Mark for each correct explanation of Automatic Type
Conversion and Type Casting)
(½ Mark for each correct example of Automatic Type
Conversion and Type Casting)
OR
(Full 2 Marks for correct example(s) demonstrating the
meaning of / difference between Automatic Type
Conversion and Type Casting)
OR
(Only 1 Mack to be awarded if Explanation without
supporting examples)
Note: Output is optional
17. 10
1. (a) What is the difference between call by
value and call by reference? Give an
example in C++ to illustrate both. 2
2010 OD
Call by value is used to create a temporary copy of
the data coming from the actual parameter into the
formal parameter. The changes done in the
function in formal parameter are not reflected back
in the calling environment. It does not use â&â sign.
Call by reference is used to share the same
memory location for actual and formal parameters
and so changes done in the function are reflected
back in the calling environment. It uses â&â sign.
18. void Compute(int A, int &B)
{
A++;
B++;
cout<<âIn the functionâ<<endl;
cout<<âA=â<<A<<â&â<<âB=â<<B<<endl;
}
void main ()
{
int I=50,J=25;
cout<<âBefore function call â<<endl;
cout<<âI=â<<I<<â&â<<âJ=â<<J <<endl;
Compute (I,J) ;
cout<<âAfter function call â<<endl;
cout<<I=â<<I<<â&â<<âJ=â<<J <<endl;
}
19. OUTPUT
Before function call
I=50&J=25
In the function
A=51&B=26
After function call
I=50&J=26
(½ Mark for each correct explanation of Call by Value and Call by
Reference)
(½ Mark for each correct example of Call by Value and Call by
Reference)
OR
(Full 2 Marks for correct examples demonstrating the difference
between
Call by Value and Call by Reference)
OR
(Only 1 Mark to be awarded if Explanation without supporting
examples)
Note: Output is optional
20. 11
1. (a) What is the difference between Local
Variable and Global Variable? Also, give a suitable
C++ code to illustrate both. 2
2011 D
Local Variables: Local variables are those variables
which are declared within a function or a compound
statement and these variables can only be used within
that function/scope.
Global Variables: Global variables are those variables
which are not declared within any function or scope. So,
these variables can be accessed by any function of the
program
21. Example
#include<iostream.h>
#include<conio.h.>
int G; // Global variable declared
void Fun ( )
{
int L = 25; // Local variable of function Fun ( ) assigned value 25
G=5; // Global Variable is accessed and assigned value 5
Cout<<G<<endl; // Value of global variable is displayed as 5
Cout<<L<<endl; // Value of local variable is displayed as 25
}
void main ( )
{
Fun ( ) ; // Function call
G = G + 5; // Global variable is incremented by 5
cout<<G<<endl; // Global variable is displayed as 10
}
(½ Mark for each correct explanation of Local Variable and Global
Variable)
(½ Mark for each correct example of Local variable and Global Variable)
OR
(Full 2 Maries for correct example(s) demonstrating the meaning of /
difference between Local Variable and Global Variable) OR
(Only 1 Mark to be awarded if Explanation without supporting examples)
22. 12
1. (a) What is the difference between automatic
type conversion and type casting? Also, give a
suitable C++ code to illustrate both. 2
2011 OD
Automatic Type Conversion: it is an implicit process of conversion
of a data from one type to another. For example
int N = 65;
char C = N; // Automatic type conversion
cout<<C;
OUTPUT:
A
Type Casting: It is an explicit process of conversion of a data from
one type to another. For example
23. int A=1, B=2;
float C = (float)A/B; //Type Casting
cout<<C;
OUTPUT:
0.5
(½ Mark for each correct explanation of Automatic Type
Conversion and Type Casting)
(½ Mark for each correct example of Automatic Type
Conversion and Type Casting)
OR
(Full 2 Marks for correct example(s) demonstrating the
meaning of / difference between Automatic Type
Conversion and Type Casting)
OR
(Only 1 Mack to be awarded if Explanation without
supporting examples)
Note: Output is optional
24. 13
1. (a) What is the difference between Global Variable and Local Variable?
Sample Paper Set I 2009
Global Variable Local Variable
ďźIt is a variable, which is declared outside all
the functions
ďźIt is accessible throughout the program
ďźIt is a variable, which is declared with
in a function or with in a compound
statement
ďźIt is accessible only within a
function/compound statement in which
it is declared.
Example :
#include <iostream.h>
float NUM=900; //NUM is a global variable
void LOCAL(int T)
{
int Total=0; //Total is a local variable
for (int I=0;I<T;I++)
Total+=I;
cout<<NUM+Total;
}
void main()
{
LOCAL(45);
}
25. 14
1.
(a) What is the difference between Object Oriented
Programming and Procedural Programming? 2
Sample Paper Set II 2009
Object Oriented
Programming
Procedural
Programming
ďźEmphasis on Data
ďźFollows Bottom-Up approach in
program design
ďźData hiding feature prevents
accidental change in data
ďźFeatures like data
encapsulation, polymorphism,
inheritance are present
ďźEmphasis on doing things
(functions)
ďźFollows Top-down
approach in program design
ďźPresence of Global
variables increase chances
of accidental change in data
ďźSuch features are not
available
26. 15
1. (a) What is the difference between Global Variable and Local Variable?
(Sample Paper 2010 (Repeated it was asked in Sample Paper Set 1 2009) )
Global Variable Local Variable
ďźIt is a variable, which is declared outside all
the functions
ďźIt is accessible throughout the program
ďźIt is a variable, which is declared with
in a function or with in a compound
statement
ďźIt is accessible only within a
function/compound statement in which
it is declared.
Example :
#include <iostream.h>
float NUM=900; //NUM is a global variable
void LOCAL(int T)
{
int Total=0; //Total is a local variable
for (int I=0;I<T;I++)
Total+=I;
cout<<NUM+Total;
}
void main()
{
LOCAL(45);
}
27. 16
Sample Paper Set II - 2010 (asked in 2009 OD)
Actual Parameter Formal Parameter
ďźIt is a parameter, which is used in function
call to send the value from the calling
environment.
It is the parameter, which is
used in function header, to
receive the value from the
actual parameter.
Example :
#include <iostream.h>
void Calc ( int T ) // T is formal parameter
{
cout<< 5 * T;
}
void main ( )
{
int A=45;
Calc ( A ); // A is actual parameter
}
(1 Mark for stating difference)
( 1 Mark for the suitable example)
OR
(Full 2 Marks for explanation of differences with the help of example)
( 1 Mark for the example)
1 ( a ) What is the difference between Actual Parameter and Formal
Parameters ? Also, give a suitable C++ code to illustrate both. 2
28. 17
Sample Paper Set I - 2012
Post-increment Pre-increment
ďź++ is an increment operator to increment
the value of a variable by one , when used
after the operand it is known as post â
increment operator.
ďźWhen it is used before an operand to
increment its value by one, it is called
pre â increment operator.
Example :
#include <iostream.h>
void main ( )
{
int NUM=9;
cout<<++NUM ; // 10 will be displayed
cout<<NUM++ ; // 10 will be displayed
Cout<< NUM ; // 11 will be displayed
}
(1 Mark for stating difference)
( 1 Mark for the suitable example)
OR
(Full 2 Marks for explanation of differences with the help of example)
( 1 Mark for the example)
1 (a) Differentiate between the post-increment and pre-increment
operators. Also, give suitable C++ code to illustrate both.
29. 18
Sample Paper Set II - 2010 (asked in 2009 OD and Sample Paper 2010 Set II)
Actual Parameter Formal Parameter
ďźIt is a parameter, which is used in function
call to send the value from the calling
environment.
It is the parameter, which is
used in function header, to
receive the value from the
actual parameter.
Example :
#include <iostream.h>
void Calc ( int T ) // T is formal parameter
{
cout<< 5 * T;
}
void main ( )
{
int A=45;
Calc ( A ); // A is actual parameter
}
(1 Mark for stating difference)
( 1 Mark for the suitable example)
OR
(Full 2 Marks for explanation of differences with the help of example)
( 1 Mark for the example)
1 ( a ) What is the difference between Actual Parameter and Formal
Parameters ? Also, give a suitable C++ code to illustrate both. 2
30. 19
1. (a) What is the difference between automatic
type conversion and type casting? Also, give a
suitable C++ code to illustrate both. 2
2012 OD ( Repeated, asked in the year 2010 Delhi Paper)
Automatic Type Conversion: it is an implicit process of conversion
of a data from one type to another. For example
int N = 65;
char C = N; // Automatic type conversion
cout<<C;
OUTPUT:
A
Type Casting: It is an explicit process of conversion of a data from
one type to another. For example
31. int A=1, B=2;
float C = (float)A/B; //Type Casting
cout<<C;
OUTPUT:
0.5
(½ Mark for each correct explanation of Automatic Type
Conversion and Type Casting)
(½ Mark for each correct example of Automatic Type
Conversion and Type Casting)
OR
(Full 2 Marks for correct example(s) demonstrating the
meaning of / difference between Automatic Type
Conversion and Type Casting)
OR
(Only 1 Mack to be awarded if Explanation without
supporting examples)
Note: Output is optional