Programming in C, IDE, main() function, global and local variables.

Topic: Programming in C

Question 1: Describe the programming environment.

Answer: Programming environment is the set of processes and programming tools used to develop computer programs. In the past programmers used various standalone programming tools for developing computer programs. These includes editor, compiler, linker, debugger, etc. Using separate programs provided a difficult and time consuming environment for creating a computer programs. Today programmers use IDE.

 
Question 2: What is integrated development environment?

Answer: Most of the new programming languages use integrated development environment (IDE) to create, compile and run programs. IDE is computer software that brings all the processes and tools required for program development into one place. Today’s modern IDEs have user friendly graphical user interface(GUI).

 

Question 3: Describe the purpose of the main() function and the  body of main() function.

Ans: Every C program must have the function main() which is the first section to be executed when the program runs. The word void before the function main() means that this function does not return a value and the second void inside the brackets means it does not have any argument. When we run a program the main() function is always executed first no matter where it appears in the program.

 The body of main() Function.

 The body of the function main() is surrounded by braces {}. The left brace indicates the start of the body of the function and the right brace indicates the end of the body of the function.

Question 4: Define global and local variables.

Ans: Variables are used in C program to store values.

 Global Variables.

Global variables are declared before the main() function. These variables are used anywhere in the program.

 Local Variables.

Local Variables are declared within main() function and are used only within a function in which they are declared.

Comments

Popular posts from this blog

Conditional Control structure. Chapter 4, Lab Activities, Long questions.

Chapter # 5, Loop Control Structure, Lab Activities