3. ο Developed by Dennis Ritchie
between 1969 & 1973.
ο Developed at the Bell
Laboratories, aimed to use with
UNIX OS.
ο Widely used for developing
application software, though it
was mainly invented for
developing system software.
4. Q.2: What is a static
variable in context of C
language?
5. ο Declared inside a function.
ο Declared for function name.
ο Declared for Global parameters.
6. Q.3: Can you explain the
difference between a
normal variable and a
pointer?
7. ο A normal variable can have any value
and can be changed throughout the
length of the program.
ο A pointer defines the address where
another variable is stored and not any
value.
8. Q.4: What is the
difference
between calloc() and
malloc()?
9. ο malloc() will create single block of memory of
size specified by the user.
ο Example - p=(int*)malloc(sizeof(int)*5)
ο calloc() takes two arguments and zero initializes
the memory. It can assign multiple blocks of
memory for a variable.
ο Example - p=(int*)calloc(5,sizeof(int)*5)
10. Q.5: What is the
difference between printf()
and sprint()?
11. ο Printf() outputs the data to the standard
output device which is usually the
computer monitor.
ο Sprint() outputs the data to a character
array.
12. Q.6: Which is the fastest
sorting method you can
use while programming in
c language?
13. This is a question which falls into βThere is no
one-size-fits-all answerβ category. But few
options are-
ο Quick sort.
ο Radix sort.
ο Merge sort.
14. Q.7: Is using functions or
macros better when
programming in C?
15. ο Macros are generally more efficient and
faster.
ο Macros cannot handle complex programming
constructs and in such cases functions are
used
ο We can choose macros or functions based on
our priority - speed vs. size of program.
17. ο Stack is where information required to call
and return function resides
ο It also stores a functions local variable
ο Stack follows a FIFO model
19. ο C++ is an advanced version of C which
introduced a lot of new features like
classes and so on.
ο Itβs much more object oriented compared to
the general purpose programming C was
initially created for.
21. ο goto statements are used to implement a
local jump during program execution.
ο It is not considered a good practice to use
goto statements and should be avoided as
much as possible.