Diffenentiate between an internal static and external static variable?
Some main difference between internal static and external static are given below:
We declare the internal static variable inside a block with static storage class. External static variable is declared outside all the blocks in a file.
In internal static variable has persistent storage,no linkage and block scope, where as in external static variable has permanent storage,internal linkage and file scope.Reply
What is auto variables?
by default variables are auto.as we know that variable changes its character according to the strage class .
What are the advantages of auto variables?
Some main advantages of auto variables are given below:
1.we can use the same auto variable name in different blocks.
2.No side effect by changing the values in the blocks.
3.It used memory economically.
4.Because of local scope auto variables have inherent protection.
what are storage variable ?
A storage class changes the behavior of a variable. It use to controls the lifetime, scope and linkage.
There are five types of storage classes :
What is Storage class ?
There are four type of storage class in C:
Which expression always return true?and Which always return false?
Expression are given below;
if (a=0) always return false.
if (a=1) always return true.
What is equivalent expression for x%8?
Get the remainderReply
Which one is faster n++ or n+1?Why??
The expression n++ requires a single machine instruction. n+1 requires more instructions to carry out this operation.
What are the restrictions of a modulus operator?
The modulus operator is denoted in c by symbol %.
we have two integer values x and y and then the operation x % y called as x modulus y gives the result as (x- (x / y) * y).
Say if x=18 and y =5 the x % y gives value as (18- (18 / 5) * 5) which gives (18-15) which results in 3 in other words the remainder of the division operation.
But there is a restriction in C language while using the modulus operator. There are two types of numerical data types namely integers, floats, double. But modulus operator can operator only on integers and cannot operate on floats or double. If anyone tries to use the modulus operator on floats then the compiler would display error message as �Illegal use of Floating Point�.Reply
What is a modulus operator?
it gives reminder of any division operationReply
% is modulus operator .
Replied By: Name: Rajesh