The C library that contains the standard input and output functions
stdio
How would you declare a integer called x that is equal to 5
int x = 5;
How would you declare a string called name with a length of 5 that is not given an initial value.
char name[5];
The return type when not returning any data type
Void
How do you declare an integer array of length 5 called numbers
int numbers[5];
The C function that displays text to the screen
printf()
How would you declare 2 characters called x and y
char x , y;
The library for string functions
string.h
A declaration that tells the compiler about a function's name, return type, and parameters before its actual definition
Function prototype
What is arr[2]?
int arr[5] = {1,2,3,4,5};
3
The C function that reads in user input
scanf
What will print (assume successful inputs):
int a = 1, b = 0;
b = scanf("%d %d", &var1, &var2);
b=a;
printf("%d", b);
1
What will print if testing123 is entered:
char a2[5];
scanf("%s", a2);
printf("%s", a2);
testing123
DONT DO THIS!!!!!!
How would you call this function:
int fun1(int var1);
fun1(int variable);
What will print:
int arr[5] = {1,2,3,4,5};
printf("%d", sizeof(arr));
20
What will a be equal to (assume successful inputs):
int a = 1, b = 0, var1, var2;
b = scanf("%d %d", &var1, &var2);
a = b;
2
The operator used to shorthand addition
+=
The function to copy n number of characters to the beginning of a string
strncpy()
Fill in the blank
BLANK test(int x, int * y){
x = 3;
y = &x;
return y;
}
int *
What will print:
int arr[7] = {1,2,3,4,5};
int arr [8] = 2;
printf("%d", sizeof(arr));
Error
What will b be equal to if "test" was entered:
int b = 0;
char a2[5];
b = scanf("%s", a2);
1
Fill in the 3 blank lines to successfully swap the values of x and y
int x = 1, y = 2, z;
BLANK
BLANK
BLANK
printf("%d %d", x, y);
z = x;
x = y;
y = z;
What will print :
char a2[] = "cats";
printf("%d, %d ", strlen(a2), sizeof(a2));
4 , 5
Fill in the blank for the factorial recursive function
int multiplyNumbers(int n) {
if (n>=1)
BLANK
else
return 1; }
return n*multiplyNumbers(n-1);
How many 0 in this array?
int arr[2][8] = {1,0,3,4,5};
12