1) Define the following (i) identifier (ii) variable, and write the general syntax of a variable declaration 2) How ma
Posted: Sun May 15, 2022 1:40 pm
1) Define the following (i) identifier (ii) variable, and write the general syntax of a variable
declaration
2) How many reserved keywords make up the C language? List six of these keywords
3) Write down the fundamental data types in the C language
4) Write down the general structure of a C program [4 Marks]What is meant by a function in C?
5) What is meant by a function in C
6) Write the general form of a (i) function declaration (ii) function definition
7) What is the difference between a function argument and a formal parameter?
8)Write a C program with a function the returns a maximum between two integers. HINT:
declare two integers x and y; the function should be named max(); the statement “x is greater
than y” should be printed if x is greater than y, otherwise, “ y is greater than x” should be
printed
9)Define an array in C programming, and write down its general structure.
10) Write a code snippet showing an array initialization of 10 integers in a sequence from 100 to 109
10) Write a code snippet of a function that returns the average of a set of marks for a given
students. HINT: the marks should be regarded as floating points.
11)Define a (i) C string (ii) C Structure and (iii) C Unions
12) Write two ways of initializing a string consisting of the word “computer”
13) What is the purpose of the following functions as applied to strings (i) strcpy(s1,s2)
(ii) strcat(s1, s2) (iii) strlen(s1) (iv) strcmp(s1, s2)
14) Write the general definition of a structure
15) Write the general definition of a union
declaration
2) How many reserved keywords make up the C language? List six of these keywords
3) Write down the fundamental data types in the C language
4) Write down the general structure of a C program [4 Marks]What is meant by a function in C?
5) What is meant by a function in C
6) Write the general form of a (i) function declaration (ii) function definition
7) What is the difference between a function argument and a formal parameter?
8)Write a C program with a function the returns a maximum between two integers. HINT:
declare two integers x and y; the function should be named max(); the statement “x is greater
than y” should be printed if x is greater than y, otherwise, “ y is greater than x” should be
printed
9)Define an array in C programming, and write down its general structure.
10) Write a code snippet showing an array initialization of 10 integers in a sequence from 100 to 109
10) Write a code snippet of a function that returns the average of a set of marks for a given
students. HINT: the marks should be regarded as floating points.
11)Define a (i) C string (ii) C Structure and (iii) C Unions
12) Write two ways of initializing a string consisting of the word “computer”
13) What is the purpose of the following functions as applied to strings (i) strcpy(s1,s2)
(ii) strcat(s1, s2) (iii) strlen(s1) (iv) strcmp(s1, s2)
14) Write the general definition of a structure
15) Write the general definition of a union