We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
Knowledge test
1 – Give a definition of what is an algorithm
2 – What is a definition for a variable ? 3 – In C, what is the meaning of the symbol « = » ? 4 – In C, what is the meaning of the symbol « ! » ? 5 – In C, what is the meaning of the operator « != » ? 6 – In C, what are the operators « ++ » and « -- » ? 7 – In C, if a = 12 , what is the value of a if a = (a > 12) ? a + 12 : a + 14 ; ? 8 – What are : « while », « do while » and « for » ? What is the commun name of these expressions ?. 9 – What are : « if » and « if else » ? What is the commun name of these expressions ?. 10 – What is the result of this short program : The user enter the value 42. #include <stdio.h> int main (void) { int iValue = -1 ; printf(‘’Enter a number : ‘’) scanf(‘’%d’’, &iValue) ; return iValue ; }
11 – What are the compilation phases ?
12 – Write the command line for compiling a file emp.c to obtain the executable file emp.exe : 13 – What is the meaning of the compilation directive -Wfatal- errors ? 14 – Write in C style the declaration of a character cValue and is initialization with the value ‘E’. 15 – What are the template format for printf and scanf for integer, float and string. 16 – How many bytes in memory are booked to store a float ? 17 – The ASCII code for ‘A’ is 65. What is the display of this short program ? #include <stdio.h> int main (void) { int iVariable = ‘E’ ; printf(« iVariable : %d », iVariable) ; return 0 ; }
18 – Write a C program to ask the user to enter an integer number.
Then display all of these integers by indicating if the integer is even or odd. 19 – What is the display of this sort program : int main ( ) { int a , b , c ; a=94; b=5; c =53; a=(b>5) ? a −4: a+4; b=(a<100) ? b/2 : 2*b ; c =(( b%2)==1)? c+b : c−b ; printf ( "a=%d , b=%d , c=%d \n" , a−−, b++, −−c ) ; printf ( "a=%d , b=%d , c=%d \n" , a , b , c ) ; return 0 ; }
20 – The C language was created in 1972. In which year it was fully
describe ? 21 – Bonus question. Consider the answer to question 20 as an integer. Apply the -=7 operation on it. In which year « Back to the future » take place in present day ?