Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 92 pages
Exam (elaborations)

PRF 192 Exam Questions & Answers | 100% Correct | Verified | 2024 Version

Document preview thumbnail
Preview 4 out of 92 pages

B ---- C99 standard guarantees uniqueness of ____ characters for internal names. a) 31 b) 63 c) 12 d) 14 A ---- C99 standard guarantess uniqueness of _____ characters for external names. a) 31 b) 6 c) 12 d) 14 D ---- Which of the following is not a valid variable name declaration? a) int __a3; b) int __3a; c) int __A3; d) None of the mentioned C ---- Which of the following is not a valid variable name declaration? a) int _a3; b) int a_3; c) int 3_a; d) int _3a C ---- Variable names beginning with underscore is not encouraged. Why?a) It is not standardized b) To avoid conflicts since assemblers and loaders use such names c) To avoid conflicts since library routines use such names d) To avoid conflicts with environment variables of an operating system A ---- All keywords in C are in a) LowerCase letters b) UpperCase letters c) CamelCase letters d) None A ---- Variable name resolving (number of significant characters for uniqueness of variable) depends on a) Compiler and linker implementations b) Assemblers and loaders implementations c) C language d) None D ---- Which of the following is not a valid C variable name? a) int number; b) float rate; c) int variable_count; d) int $main; C ---- Which of the following is true for variable names in C? a) They can contain alphanumeric characters as well as special characters b) It is not an error to declare a variable to be one of the keywords(like goto, static) c) Variable names cannot start with a digit d) Variable can be of any lengthB ---- Which is valid C expression? a) int my_num = 100,000; b) int my_num = 100000; c) int my num = 1000; d) int $my_num = 10000; C ---- What is the output of this C code? #include stdio.h int main() { printf("Hello World! %d n", x); return 0; } a) Hello World! x; b) Hello World! followed by a junk value c) Compile time error d) Hello World! A ---- What is the output of this C code? #include stdio.h int main() { int y = 10000; int y = 34; printf("Hello World! %dn", y); return 0;} a) Compile time error b) Hello World! 34 c) Hello World! 1000 d) Hello World! followed by a junk value D ---- Which of the following is not a valid variable name declaration? a) float PI = 3.14; b) double PI = 3.14; c) int PI = 3.14; d) #define PI 3.14 C ---- What will happen if the below program is executed? #include stdio.h int main() { int main = 3; printf("%d", main); return 0; } a) It will cause a compile-time error b) It will cause a run-time error c) It will run without any error and prints 3 d) It will experience infinite looping D ---- What is the problem in following variable declaration? float 3Bedroom-Hall-Kitchen?; a) The variable name begins with an integerb) The special character '-' c) The special character '?' d) All of the mentioned B ---- Comment on the output of this C code? #include stdio.h int main() { int ThisIsVariableName = 12; int ThisIsVariablename = 14; printf("%d", ThisIsVariablename); return 0; } a) The program will print 12 b) The program will print 14 c) The program will have a runtime error d) The program will cause a compile-time error due to redeclaration A ---- Which of the following cannot be a variable name in C? a) volatile b) true c) friend d) export D ---- Comment on the output of this C code? #include stdio.h int main(){ int a[5] = {1, 2, 3, 4, 5}; int i; for (i = 0; i 5; i++) if ((char)a[i] == '5') printf("%dn", a[i]); else printf("FAILn"); } a) The compiler will flag an error b) Program will compile and print the output 5 c) Program will compile and print the ASCII value of 5 d) Program will compile and print FAIL for 5 times B ---- The format identifier '%i' is also used for _____ data type? a) char b) int c) float d) double B ---- Which data type is most suitable for storing a number 65000 in a 32-bit system? a) signed short b) unsigned short c) long d) int D ---- Which of the following is a User-defined data type? a) typedef int Boolean; b) typedef enum {Mon, Tue, Wed, Thu, Fri} Workdays;c) struct {char name[10], int age}; d) all of the mentioned C ---- What is the size of an int data type? a) 4 Bytes b) 8 Bytes c) Depends on the system/compiler d) Cannot be determined B ---- What is the output of this C code? #include stdio.h int main() { signed char chr; chr = 128; printf("%dn", chr); return 0; } a) 128 b) -128 c) Depends on the compiler d) None of the mentioned A ---- Comment on the output of this C code? #include stdio.h int main() {char c; int i = 0; FILE *file; file = fopen("", "w+"); fprintf(file, "%c", 'a'); fprintf(file, "%c", -1); fprintf(file, "%c", 'b'); fclose(file); file = fopen("", "r"); while ((c = fgetc(file)) != -1) printf("%c", c); return 0;


Document information

Uploaded on
June 9, 2024
Number of pages
92
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers
$16.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Sold
61
Followers
19
Items
2466
Last sold
2 months ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions

Whoops! We can’t load your doc right now. Try again or contact support.