C Programming :: Typedef

Home > Technical Aptitude > C Programming > Typedef > General Questions

NA
SHSTTON
24
Solv. Corr.
16
Solv. In. Corr.
40
Attempted
0 M:0 S
Avg. Time

1 / 2

What is output or the error in the program?
#include <stdio.h>

typedef int CommVault;
typedef CommVault CommVaultindia;

void main () {
CommVaultindia val= 234;
printf("%d ",  val);
}

ACompilation error: typedef cannot be outside a function scope

BCompilation error: undefined variable val

C234

DCompilation error: cannot typedef based on another typedef

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
2
Solv. Corr.
7
Solv. In. Corr.
9
Attempted
0 M:0 S
Avg. Time

2 / 2

Choose the correct option.

The declarations

typedef float hight [100];
height men, women;


Adefine men and women as 100 element floating point arrays

Bdefine men and women as floating point variables

Cdefine height, men and women as floating point variables

DAre illegal

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace