Introduction to C Programming Language (CSCT2203)

Computer Science - COS

Semester: Resit

Level: 200

Year: 2015

Page 1 of 2
SCHOOL: H.T.T.T.C DEPARTEMENT: CS LECTURER(S): Mr. DIFOUO JEAN PATRICE
COURSE CODE: CSC217 COURSE TITLE: C PROGRAMMING LANGUAGE OPTION: CSC
DATE: September, 2015 HALL: …….. TIME: 1:30 NATURE: RESIT
INSTRUCTION: Answer all these questions.
[Question 1]: Give the conditions that must fulfill a valid identifier in C language 2MKS
[Question 2]: What is the number of values that a function can return 1MK
[Question 3]: What is the difference between an array variable and a pointer variable? 1MK
[Question 4]: Give the extension of:
1) A C source file 1MK
2) A C header file 1MK
3) A C executable file 1MK
[Question 5]: Suppose that you have the following variable declarations:
int x = 10;int y = 15; int z = 20;
Determine whether the following expressions are true or false 2MKS
a.!(x < 10) b. x <= 5 || y > 15
c.(x != 5) && (y == z) d. x <= z && (x + y >= z)
[Question 6]: Given the program below
#include <stdio.h>
#include <stdlib.h>
void toto(int n)
{
if(n<=0)printf("stop\n");
else
{
printf("%d",n);
n-=2;
toto(n);
}
}
int main(int argc, char
*argv[])
{
toto(8);
system("PAUSE");
return 0;
}
1) Give the output of that program? 2MKS
2) Give the formal parameter of toto 1MK
3) Give the effective parameter of toto 1MK
REPUBLIC OF CAMEROON
Peace Work Fatherland
***********
THE UNIVERSITY OF BAMENDA
***********
HIGHER TECHNICAL TEACHER TRAINING
COLLEGE (H.T.T.T.C.) BAMBILI
***********
DIRECTORATE OF STUDIES
**********
P.O.BOX 39 BAMBILI
REPUBLIQUE DU CAMEROON
Paix Travail - Patrie
***********
UNIVERSITE DE BAMENDA
***********
ECOLE NORMALE SUPERIEURE
D’ENSEIGNEMENT TECHNIQUE
***********
DIRECTION DES ETUDES
**********
Tél: 33 05 10 69
www.schoolfaqs.net
Page 2 of 2
[Question 7]: Given the code below
int A[]={9,12,5,10,15,1,3}, S=7,i;
for(i=0;i<S;i++)printf("%d ",A[S-1-i]);
1) Give the output of this code 1MK
2) Give the equivalent code using the while loop 2MKS
3) Write the equivalent code using the do .. while loop 2MKS
[Question 8]: Suppose that you have the following variable declarations:
int x = 10;int y = 15; int z = 20;
what are the values of x, y and z after each of the following statements 2MKS
1)x=++y;
2)z=y++;
3)y+=x;
4)z--;
[Question 9]: write a C program that reads two 4x3 matrices and calculates and displays their sum
5mks
[Question 10]: write a C program that reads 10 integer values, stores them into a linked list and then
displays them and destroy the list. 5mks
[Question 11]: you wish to write a student management program to manage a class of 30 students.
Knowing that each student has a registration number maximum 6 symbols, a name with maximum 30
characters, a sex which is either M for male or F for female, the age which is an integer and a place of
birth having less than 50 characters. Write a program in which you
1) Declare the data type student 1MK
2) Declare the global variable students to store all the students 1MK
3) Write the code to read information on all the students and store in the container students
1.5MKS
4) Write the code to display all the information on female students 1.5MKS
www.schoolfaqs.net