MCQs
True,
float = 4 bytes.
double = 8 bytes.
typedef long a;
extern int a c; while compiling this statement becomes extern int long c;. This will
result in to "Declaration syntax error".
typedef long a;
extern a int c; while compiling this statement becomes extern long int c;. This will
result in to "Too many types in declaration error".
typedef long a;
extern a c; while compiling this statement becomes extern long c;. This is a valid c
declaration statement. It says variable c is long data type and defined in some other file or module.
So, Option C is the correct answer.
True, we can use long double; if double range is not enough.
double = 8 bytes.
long double = 10 bytes.
In 2 and 3 semicolon are missing in structure element.
Option B gives "Undefined structure in 'aa'" error.
6.68 is double.
6.68L is long double constant.
6.68f is float constant.
6.68LF is not allowed in c.
The compiler will not know that the function int fun() exists. So we have to
define the function prototype of int fun();
To overcome this error, see the below program
#include<stdio.h>
int fun(); /* function prototype */
int main()
{
int(*p) () = fun;
(*p) ();
return 0;
}
int fun()
{
printf("Placementadda\n");
return 0;
}
float a = 3.14; a = a%3; gives "Illegal use of floating point" error.
The modulus (%) operator can only be used on integer types. We have to
use fmod() function in math.h for float values.
int length; denotes that variable length is int(integer) data type.
char int; here int is a keyword cannot be used a variable name.
int long; here long is a keyword cannot be used a variable name.
float double; here double is a keyword cannot be used a variable name.
So, the answer is int length;(Option A).
A typedef gives a new name to an existing data type.
So err is a new name for enum error.