Last Updated on November 1, 2019 by Admin
CLA – Programming Essentials in C Quizzes Chapter 7 Assessment Online
CLA – Chapter 7 Assessment
Quiz-summary
0 of 20 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
Information
CLA – Chapter 7 Assessment
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
0 of 20 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Average score |
|
Your score |
|
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- Answered
- Review
-
Question 1 of 20
1. Question
2 pointsThe following string:
JohnDoe
is a valid file name in
Correct
Incorrect
-
Question 2 of 20
2. Question
1 pointsUnix/Linux systems treat the following names
JohnDoe johndoe
Correct
Incorrect
-
Question 3 of 20
3. Question
1 pointsThe following string:
HomeDir/HomeFile
is a valid file name in:
Correct
Incorrect
-
Question 4 of 20
4. Question
1 pointsThe following string:
D:\USERDIR\johndoe.txt
is a valid file name in
Correct
Incorrect
-
Question 5 of 20
5. Question
1 pointsWhat happens if you try to compile and run this program?
int main(void) { FILE *f; f = fopen("file","wb"); printf("%d",f != NULL); fclose(f); return 0; }
Correct
Incorrect
-
Question 6 of 20
6. Question
1 pointsWhat happens if you try to compile and run this program?
#include <stdio.h> int main(void) { FILE f; f = fopen("file","wb"); printf("%d",f != NULL); fclose(f); return 0; }
Correct
Incorrect
-
Question 7 of 20
7. Question
1 pointsWhat happens if you try to compile and run this program assuming that fopen() succeeds?
#include <stdio.h> int main(void) { FILE *f; f = fopen("file","wb"); printf("%d",f != NULL); fclose(f); return 0; }
Correct
Incorrect
-
Question 8 of 20
8. Question
1 pointsWhat happens if you try to compile and run this program?
#include <stdio.h> int main(void) { int i; i = fprintf(stdin,"Hello!"); printf("%d",i == EOF); return 0; }
Correct
Incorrect
-
Question 9 of 20
9. Question
1 pointsWhat happens if you try to compile and run this program?
#include <stdio.h> int main(void) { int i; i = fprintf(stderr,"Hello!"); printf("%d",i == EOF); return 0; }
Correct
Incorrect
-
Question 10 of 20
10. Question
1 pointsWhat happens if you try to compile and run this program?
#include <stdio.h> int main(void) { FILE *f; int i = fprintf(f,"Hello!"); printf("%d",i == EOF); return 0; }
Correct
Incorrect
-
Question 11 of 20
11. Question
1 pointsWhat happens if you try to compile and run this program assuming that fopen() succeeds?
#include <stdio.h> int main(void) { FILE *f = fopen("file","w"); int i = fprintf(f,"Hello!"); printf("%d",i != EOF); return 0; }
Correct
Incorrect
-
Question 12 of 20
12. Question
1 pointsWhat happens if you try to compile and run this program assuming that fopen() succeeds?
#include <stdio.h> int main(void) { FILE *f = fopen("file","w"); int i = fputs(f,"Hello!"); printf("%d",i != EOF); fclose(f); return 0; }
Correct
Incorrect
-
Question 13 of 20
13. Question
1 pointsWhat happens if you try to compile and run this program assuming that fopen() succeeds?
#include <stdio.h> int main(void) { FILE *f = fopen("file","w"); int i = fputs("Hello!",f); printf("%d",i != EOF); return 0; }
Correct
Incorrect
-
Question 14 of 20
14. Question
1 pointsWhat happens if you try to compile and run this program assuming that fopen() succeeds?
#include <stdio.h> int main(void) { char s[20]; FILE *f = fopen("file","w"); int i = fputs("12A",f); fclose(f); f = fopen("file","r"); fgets(s,2,f); puts(s); fclose(f); return 0; }
Correct
Incorrect
-
Question 15 of 20
15. Question
1 pointsWhat happens if you try to compile and run this program assuming that fopen() succeeds?
#include <stdio.h> int main(void) { char s[20]; FILE *f = fopen("file","w"); int i = fputs("12A",f); fclose(f); f = fopen("file","r"); fgets(s,20,f); puts(s); fclose(f); return 0; }
Correct
Incorrect
-
Question 16 of 20
16. Question
1 pointsWhat happens if you try to compile and run this program assuming that fopen() succeeds?
#include <stdio.h> int main(void) { FILE *f = fopen("file","w"); int i; fputs("12A",f); fclose(f); f = fopen("file","r"); fseek(f,0,SEEK_END); i = ftell(f); fclose(f); printf("%d",i); return 0; }
Correct
Incorrect
-
Question 17 of 20
17. Question
1 pointsWhat happens if you try to compile and run this program assuming that fopen() succeeds?
#include <stdio.h> int main(void) { FILE *f = fopen("file","w"); int i; fputs("12A",f); fclose(f); f = fopen("file","r"); fseek(f); i = ftell(f,0,SEEK_END); fclose(f); printf("%d",i); return 0; }
Correct
Incorrect
-
Question 18 of 20
18. Question
1 pointsWhat happens if you try to compile and run this program assuming that fopen() succeeds?
#include <stdio.h> int main(void) { FILE *f = fopen("file","w"); int i; fputs("12A",f); fclose(f); f = fopen("file","r"); fscanf(f,"%d",&i); fclose(f); printf("%d",i); return 0; }
Correct
Incorrect
-
Question 19 of 20
19. Question
1 pointsWhat happens if you try to compile and run this program assuming that fopen() succeeds?
#include <stdio.h> int main(void) { FILE *f = fopen("file","w"); char c; fputs("12A",f); fclose(f); f = fopen("file","r"); fscanf(f,"%c",&c); fclose(f); printf("%c",c); return 0; }
#include <stdio.h> int main(void) { FILE *f = fopen("file","w"); char c; fputs("12A",f); fclose(f); f = fopen("file","r"); fscanf(f,"%c",&c); fclose(f); printf("%c",c); return 0; }
Correct
Incorrect
-
Question 20 of 20
20. Question
1 pointsWhat happens if you try to compile and run this program?
#include <stdio.h> int main(void) { FILE *f = fopen("file","w"); float f; fputs("12A",f); fclose(f); f = fopen("file","r"); fscanf(f,"%f",&f); fclose(f); printf("%f",f); return 0; }
Correct
Incorrect