Can we assign a float variable to a long integer variable?
Yes, with loss of fractional part.
Explain Local Static Variables and what is their use?
A local static variable is a variable whose life doesn’t end with a function call where it is declared. It extends for the lifetime of the complete program. All calls to the function share the same copy of local static variables.
#include
void fun()
{
static int x;
printf("%d ", x);
x = x + 1;
}
int main()
{
fun();
fun();
return 0;
}
Output: 0 1
Where an automatic variable is stored?
Every local variable by default being an auto variable is stored in stack memory.
What is the difference between variable declaration and variable definition?
Declaration associates type to the variable whereas definition gives the value to the variable.
What is the acronym for ANSI?
The ANSI stands for " American National Standard Institute." It is an organization that maintains a broad range of disciplines including photographic film, computer languages, data encoding, mechanical parts, safety, and more.
What is the newline escape sequence?
The new line escape sequence is represented by "\n". It inserts a new line on the output screen.
Can I use int datatype to store 32768 value?
No, the Integer datatype will support the range between -32768 and 32767. Any value exceeding that will not be stored. We can either use float or long int.
Explain the purpose of the function sprintf().
Prints the formatted output onto the character array.
What is typecasting?
Typecasting is a way to convert a variable/constant from one type to another type.
What is a C Token?
Keywords, Constants, Special Symbols, Strings, Operators, Identifiers used in the C program are referred to as C Tokens.