Sei sulla pagina 1di 4

1.What is a pointer?

A:A pointer is a variable whose value is the address of another variable, i.e., direct address of the
memory location. Like any variable or constant, you must declare a pointer before using it to
store any variable address.

2.What is a dangling pointer?

A:If a pointer still references the original memory after it has been freed, it is called a dangling
pointer. The pointer does not point to a valid object. This is sometimes referred to as a
premature free.

3.What is a data type?

A:A data type, in programming, is a classification that specifies which type of value a variable has
and what type of mathematical, relational or logical operations can be applied to it without
causing an error.

4.What is size of integer data type?

A:The size of integer datatype is 2ytes or 4 bytes.

5.What is the size of char data type?

A:The sizre of char data type is 1 byte.

6.What is the size of unsigned char?

A:The size of unsigned datatype is 1 byte.

7.What is the size of signed char?

A:The size of char data type is 1 byte.

8.What is the size of long?

A:The size of long datatype is 4bytes.

9.hat is the size of short?

A:The size of short data type is 2bytes.

10.What is the range of integer data type in C?

A:The range of integer data type is -32,768 to 32,767.

11.What is the size of float data type?

A:The size of float data type is 4 bytes.


12.What is malloc?

In C, the library function malloc is used to allocate a block of memory on the heap. The program
accesses this block of memory via a pointer that malloc returns. When the memory is no longer
needed, the pointer is passed to free which deallocates the memory so that it can be used for
other purposes.

13.What is the difference between do while and for loop?

A:

14.What is a string?

A:A string is a data type used in programming, such as an integer and floating point unit, but is
used to represent text rather than numbers. It is comprised of a set of characters that can also
contain spaces and numbers.

15./0 in string?

A:The null character '\0' (also null terminator ), abbreviated NUL , is a control character with the
value zero.

16.What is recursion?

A:Recursion is the process of repeating items in a self-similar way. In programming languages, if a


program allows you to call a function inside the same function, then it is called a recursive call of
the function.

17.What is printf?

A: Printf is a pre defined function which is defined by header file stdio.h basically Printf is used to
print the value of any variable.

18.What is math.h?

A:The math.h header defines various mathematical functions and one macro. All the functions
available in this library take double as an argument and return double as the result.

19.What is the argument of a function?

A:A function in C can be called either with arguments or without arguments. These function may
or may not return values to the calling functions. All C functions can be called either with
arguments or without arguments in a C program. Also, they may or may not return any values.

20.What is assignment operator in C?

A:Assignment Operator is Used to assign value to an variable. Assignment Operator is denoted


by equal to sign. Assignment Operator is binary operator which operates on two operands.
21.What is the relational operator in C?

A:Relational operators are used to compare values of two expression. Relational operators are
binary operators because they require two operands to operate. An expression which contains
the relational operators is called relational expression.

22.What is the logical operator in C?

A:An expression containing logical operator returns either 0 or 1 depending upon whether
expression results true or false. Logical operators are commonly used in decision making in C
programming.

23.What is the bitwise operator in C?

A:A bitwise operator is an operator used to perform bitwise operations on bit patterns or binary
numerals that involve the manipulation of individual bits.

24.What are all decision control statements in C?

A:In decision control statements (if-else and nested if), group of statements are executed when
condition is true. If condition is false, then else part statements are executed. There are 3 types
of decision making control statements in C language.

25.What are all loop control statements in C?

A:With loop control statements, you can repeatedly execute a block of code. There are two types
of loops: for statements loop a specific number of times, and keep track of each iteration with an
incrementing index variable. while statements loop as long as a condition remains true.

26.What is the difference between while and do-while loops in C?

A:In C, do...while loop is very similar to while loop. Only difference between these two loops is
that, in while loops, test expression is checked at first but, in do...while loop code is executed at
first then the condition is checked. So, the code are executed at least once in do...while loops.

27.What is the difference between single equal “=” and double equal “==” operators in C?

A:Single equal is an assignment operator used to assign the values to the variables. But, double
equal is relational operator used to compare two variable values whether they are equal are not.

28.What is the difference between pre increment operator and post increment operator?

A:In C, expressions have values and side effects. For pre- and post- increment, the side effect is
the same - the variable is incremented. But they differ in value. With pre-increment, the value of
the expression is before the increment, and with post-increment, it's after.

29.What is the difference between pre decrement operator and post decrement operator?
A:Pre decrement operator is used to decrement variable value by 1 before assigning the value to
the variable. Post decrement operator is used to decrement variable value by 1 after assigning
the value to the variable.

30.What is “&” and “*” operators in C?

A:&-Binary AND Operator copies a bit to the result if it exists in both operands.

*-Pointer to a variable.

Potrebbero piacerti anche