ITP - Assignment 1

advertisement

INTRODUCTION TO PROGRAMMING

ASSIGNMENT # 01

Q1. What are four basic types of constants in C?

Q2. What rules apply to integer constants? How are decimal, octal, hexadecimal constants distinguished from each other?

Q3. What are 4 basic data type qualifiers? To which data type each qualifier can be applied?

Q4. State TRUE or FALSE:

 main() is where program begins a execution.

Syntax error and logical errors are same.

Void is just a notation used with main().

A printf statement can generate only one line of output.

C is not a case sensitive language.

Every line of a C program must end with a Semicolon.

Q5. Write the output of following code:

#include<stdio.h>

#include<conio.h> void main()

{ int i,j; clrscr(); i=10; j=++i; printf("%d",j); getch();

}

Q6. Write the output of following code:

#include<stdio.h>

#include<conio.h> void main()

{ unsigned int i=-1; unsigned int j; clrscr(); printf("%u",++i); printf("%u",j=-i); getch();

}

Q7. What is the difference between the following two # include directives?

#include ”conio.h”

#include <conio.h>

Q8. What is a header file & discuss its significance in ‘C’ program?

----------------------------------------------------------------------------------------------------------

Download