Skip to main content

Posts

Showing posts with the label C Programming Test Upwork

C Programming Test Upwork Answers 2019

1. Identify the incorrect statement. Answers: Records can be defined in C by using structures Structure members can be of the same/different data types Memory is reserved when a structure label is defined A pointer to a structure can be used to pass a structure to a function Arrays of structures can be defined and initialized 2. What will be printed on the standard output as a result of the following code snippet? void func() { static int i = 1; int j = 1; i++; j++; printf(“%d %d “,i,j); } void main() { func(); func(); func(); } Answers: 2 2 2 2 2 2 2 2 3 2 4 2 2 2 2 3 2 4 2 2 3 3 4 4 None of these 3. Given the following array: int a[8] = {1,2,3,4,5,6,7,0};  what would be the output of  printf(“%d”,a[4]); ? Answers: 3 4 5 6 7 4. Which function will convert a string into an integer? Answers: int() number() atoi() val() tonum() 5. Which standard function is used to clear memory allocated by the malloc() func...