InidBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming Java Programming
Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test
Group Disucssion HR Interview Questions Technical Interview Questions Body Language

Exercise

"No one is as deaf as the man who will not listen."
- (Proverb)

C Programming - Declarations and Initializations

1. 

Is the following statement a declaration or definition?
extern int i;

A.
Declaration
B. Definition
C. FunctionD. Error

2. 

Identify which of the following are declarations
1 : extern int x;
2 : float square ( float x ) { ... }
3 : double pow(double, double);

A. 1B. 2
C.
1 and 3
D. 3

3. 

In the following program where is the variable a getting defined and where it is getting declared?

#include<stdio.h>
int main()
{
    extern int a;
    printf("%d\n", a);
    return 0;
}
int a=20;

A.
extern int a is declaration, int a = 20 is the definition
B. int a = 20 is declaration, extern int a is the definition
C. int a = 20 is definition, a is not defined
D. a is declared, a is not defined

4. 

When we mention the prototype of a function are we defining the function or declaring it?

A. DefiningB.
Declaring
C. PrototypingD. Calling

5. 

What's the difference between following declarations?
1 : extern int fun();
2 : int fun();

A. extern int fun(); is in another file
B.
No difference, except extern int fun(); is in another file
C. int fun(); is overrided with extern int fun();
D. None of these



© 2008-2010 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy