Valid CLA-11-03 Dumps shared by ExamDiscuss.com for Helping Passing CLA-11-03 Exam! ExamDiscuss.com now offer the newest CLA-11-03 exam dumps, the ExamDiscuss.com CLA-11-03 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com CLA-11-03 dumps with Test Engine here:
What happens if you try to compile and run this program? #include <stdio.h> #include <stdlib.h> void fun (void) { return 3.1415; } int main (int argc, char *argv[]) { int i = fun(3.1415); printf("%d",i); return 0; } Choose the right answer:
Correct Answer: E
The program is not a valid C program and cannot be compiled successfully. The reason is that the program has two syntax errors: *The function fun has a void return type, which means it cannot return any value. However, the function tries to return a floating-point value of 3.1415, which is incompatible with the re-turn type. This will cause a compilation error. *The function main is defined inside the function fun, which is not allowed in C. A function cannot be nested inside another function. This will also cause a compilation error. To fix these errors, the function fun should have a double return type, and the function main should be defined outside the function fun. For example: #include <stdio.h> #include <stdlib.h> double fun (void) { return 3.1415; } int main (int argc, char *argv[]) { int i = fun(3.1415); printf("%d",i); return 0; } References = C - Functions - Tutorialspoint, C - return Statement - Tutorialspoint, C Basic Syntax