CBSE BOARD XII, asked by sachdevakavish72, 7 months ago

explain various parts of a program?​

Answers

Answered by raotd
1

Answer:Functions are used for Placing or Storing the Code which is to be Repeated Several Times. For Example, if we need Same Code, then we must have to Write that Code Again and Again So that for Removing this Task, we uses functions.

The Functions are Some Storage Area which Contains set of Statements and the Function Executes all the Contained Statements when a Special Call is made to them. Once a Code is stored in the Function, then we can Store that Function any time and Any Time we can call that Functions.

Functions are used for performing the repetitive task or we can say the functions are those which provides us the better efficiency of a program it provides us the facility to make a functions which contains a set of instructions of the repetitive types or we need them in a program at various places Thus a functions provides us the ability to make a function which contains a code and then use them when a functions can call then it executes the statements those are contained in it.

Functions Provides us Following Features

• Reusability of Code : Means Once a Code has Developed then we can use that Code any Time.

• Remove Redundancy: Means a user doesn’t need to Write Code Again and Again.

• Decrease Complexity: Means a Large program will be Stored in the Two or More Functions. So that this will makes easy for a user to understand that Code.

There are Two Types of Functions

• Built in Functions

• User Defined functions

The Functions those are provided by C Language are refers to the Built in Functions For example. cin and cout, getch , Clrscr are the Examples of Built in Functions. So that all the functions those are provided by the C++ Language are Pre defined and Stored in the Form of header Files so that a user doesn’t need to Know how this Function has developed and a user just use that Function.

But in the other hand the Functions those are developed by the user for their Programs are known as User Defined Programs. When a user wants to make his Own Function, then he must have to follow the Following Operations.

• Function Declaration or Prototyping

• Function Defining

• Calling a Function

Explanation:

Answered by jayamindia2000
2
Preprocessor Directives
A C++ compiler’s first action is to call another tool called the preprocessor that examines the source code. This happens automatically each time the compiler runs.

The first character in line 1 is the # symbol, which indicates that the line is a command to be handled by the preprocessor. These commands are called preprocessor directives. The preprocessor’s job is to read source code looking for directives and modify the code according to the indicated directive. The modified code is fed to the compiler.

The preprocessor serves as an editor of code right before it is compiled. Each directive is a command telling that editor what to do.

The #include directive tells the preprocessor to include the entire contents of a designated filename at that spot in a program. As you learned in Hour 1, “Writing Your First Program,” C++ includes a standard library of source code that can be used in your programs to perform useful functionality. The code in the iostream file supports input and output tasks such as displaying information onscreen and taking input from a user.

The < and > brackets around the filename iostream tell the preprocessor to look in a standard set of locations for the file. Because of the brackets, the preprocessor looks for the iostream file in the folder that holds header files for the compiler. These files also are called include files because they are included in a program’s source code.
Similar questions