# C Programming Language: Test Your Skills! Trivia Quiz

10 Questions | Total Attempts: 63 Settings Are you looking to test your skills when it comes to the C programming language? This is the most popular language when it comes to writing operating software due to its flexibility and easy to use. The name from this application came up as a result of it coming after the B language. See how good you are in using it by taking this quiz.

Related Topics
• 1.
Point out the correct statements are correct about the program below? #include<stdio.h> int main() { char ch; while(x=0;x<=255;x++) printf("ASCII value of %d character %c\n", x, x); return 0; }
• A.

The code generates an infinite loop

• B.

The code prints all ASCII values and its characters

• C.

Error: x undeclared identifier

• D.

Error: while statement missing

• 2.
Which of the following is the correct usage of conditional operators used in C?
• A.

A>b ? c=30 : c=40;

• B.

A>b ? c=30;

• C.

Max = a>b ? a>c?a:c:b>c?b:c

• D.

Return (a>b)?(a:b)

• 3.
What will be the output of the program? #include<stdio.h> #include<math.h> int main() { float n=1.54; printf("%f, %f\n", ceil(n), floor(n)); return 0; }
• A.

2.000000, 1.000000

• B.

1.500000, 1.500000

• C.

1.550000, 2.000000

• D.

1.000000, 2.000000

• 4.
What will be the output of the program? #include<stdio.h> int main() { float d=2.25; printf("%e,", d); printf("%f,", d); printf("%g,", d); printf("%lf", d); return 0; }
• A.

2.2, 2.50, 2.50, 2.5

• B.

2.2e, 2.25f, 2.00, 2.25

• C.

2.250000e+000, 2.250000, 2.25, 2.250000

• D.

Error

• 5.
Point out the error in the program #include<stdio.h> int main() { int i; #if A printf("Enter any number:"); scanf("%d", &i); #elif B printf("The number is odd"); return 0; }
• A.

Error: unexpected end of file because there is no matching #endif

• B.

The number is odd

• C.

Garbage values

• D.

None of above

• 6.
If a function contains two return statements successively, the compiler will generate warnings.
• A.

True

• B.

False

• 7.
What will be the output of the program ? #include<stdio.h> int main() { float arr[] = {12.4, 2.3, 4.5, 6.7}; printf("%d\n", sizeof(arr)/sizeof(arr)); return 0; }
• A.

5

• B.

4

• C.

6

• D.

7

• 8.
Which of the following statements correct about the below program? #include<stdio.h> int main() { union a { int i; char ch; }; union a u1 = {512}; union a u2 = {0, 2}; return 0; } 1: u2 CANNOT be initialized as shown. 2: u1 can be initialized as shown. 3: To initialize char ch[] of u2 '.' operator should be used. 4: The code causes an error 'Declaration syntax error'
• A.

1,2

• B.

2,3

• C.

1,2,3

• D.

2,4

• 9.
Is there any difference int the following declarations? int fun(int arr[]); int fun(int arr);
• A.

True

• B.

False

• 10.
What will be the output of the program? #include<stdio.h> int get(); int main() { const int x = get(); printf("%d", x); return 0; } int get() { return 20; }
• A.

Garbage value

• B.

20

• C.

Error

• D.

0
{"ft_lang_label":"__label__en","ft_lang_prob":0.7767043,"math_prob":0.91523886,"size":919,"snap":"2020-45-2020-50","text_gpt3_token_len":322,"char_repetition_ratio":0.12677595,"word_repetition_ratio":0.0,"special_character_ratio":0.39173013,"punctuation_ratio":0.2265625,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97440237,"pos_list":[0,1,2,3,4,5,6,7,8],"im_url_duplicate_count":[null,null,null,null,null,null,null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-10-22T03:30:50Z\",\"WARC-Record-ID\":\"<urn:uuid:941d769f-c799-4231-83d4-935245fdd114>\",\"Content-Length\":\"245524\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b652a637-3ac0-4271-a5f9-742a42b11bfd>\",\"WARC-Concurrent-To\":\"<urn:uuid:49e5efee-84fd-434d-8c25-4b1ed324839d>\",\"WARC-IP-Address\":\"104.26.13.111\",\"WARC-Target-URI\":\"https://www.proprofs.com/quiz-school/story.php?title=test-your-c-skills2\",\"WARC-Payload-Digest\":\"sha1:XE4PTNLDURXNUL5JQITHM3NXNT3XEU6I\",\"WARC-Block-Digest\":\"sha1:TSNPIDCBUTV4M7QYQIDMY75LXQRGTI2R\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-45/CC-MAIN-2020-45_segments_1603107878879.33_warc_CC-MAIN-20201022024236-20201022054236-00135.warc.gz\"}"}