In: Computer Science
No.1)
a) Preprocessing is the task of taking input data and produces output that is to be actually compiled. For example, in C language, there are certain '#' sybmol followed by the name which has to be processed for subsequent stage. These are called preprocessor directives. Some examples are #define, #include, #ifdef and #endif.
b) In stack, the allocation and deallocation of memory is done automatically which happens due to predefined routes during compilation, whereas in Heap, the allocation of memory is done while execution of program written by the user. In stack, the memory once allocated can't be changed, whereas in Heap, the memory allocated can be altered.
c) Stack follows LIFO(Last In First Out) principle whereas a queue follows FIFO(First In First Out) principle. In stack, insertion and deletion takes place from on end only, but for queue, insertion and deletion takes place from opposite end.
d) A compiler takes the code of a program written in HLL(High Level Language) and converts it into machine readable form. The C compiler used is GCC(GNU Compiler Collection).
e) A pointer is a variable that stores address of another variable or a memory location.
No.2)
#include<stdio.h>
void main(){
int var;
scanf("%d", &var);
return 0;
}