You are on page 1of 1

Lab 4

1. List four (4) different primitive data types


char, int, float, double

2. What are operators?


Operators are the symbols that are used for mathematical, relational, logical
manipulation and so on.

3. Explain the term named constant.


The named constant is an initial value which is declared by programmer and it can’t
be changed.

4. Fill in the following table:

Data type Format specifier


char %c
int %d
float %f

5. Write a single C statement for the following:


a) Declare a variable student_id as an integer.
#include <stdio.h>

int main()
{
int student_id;

return 0;
}

b) Declare a variable a as an integer with initial value of 1.


#include <stdio.h>

int main()
{
int initial_value = 1;

return 0;
}

You might also like