Java C Basics Test 3 - Java C Basics Question and Answers
Finish Quiz
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
Java C Basics Test 3 – Java C Basics Question and Answers. Test your JAVA C Basics Fundamentals with our free Java C Basics online Quiz. Java C Basics Test 3 Question and Answers 2024. Java C Basics Quiz 3 Question and Answers 2024. Java online Test Quiz 3. Java C Basics Quiz 3 Free Mock Test 2024. Java C Basics Quiz 3 Question and Answers in PDF. The Java online mock test paper is free for all students. Spring Online is very useful for exam preparation and getting for Rank. Java C Basics Quiz 3 Question and Answers in English. Java C Basics Mock test for topic via C Basics Mode. Here we are providing Java C Basics Quiz in English Now Test your self for “C Basics Online Quiz in English” Exam by using below quiz…
This paper has 20 questions.
Time allowed is 25 minutes.
The Java C Basics Mock Test is Very helpful for all students. Now Scroll down below n click on “Start Quiz” or “Start Test” and Test yourself.
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%
Pos. | Name | Entered on | Points | Result |
---|---|---|---|---|
Table is loading | ||||
No data available | ||||
- 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
What is the output of the program
#include<stdio.h>
int main()
{
extern int fun(float);
int a;
a = fun(3.14);
printf(“%d “, a);
return 0;
}
int fun(int aa)
{
return (int)++aa;
}Correct
Incorrect
-
Question 2 of 20
2. Question
What will be the output of the program?
#include<stdio.h>
int X=40;
int main()
{
int X=20;
printf(“%d “, X);
return 0;
}Correct
Incorrect
-
Question 3 of 20
3. Question
What is the output of the program
#include<stdio.h>
int main()
{
int a[5] = {2, 3};
printf(“%d, %d, %d “, a[2], a[3], a[4]);
return 0;
}Correct
When an automatic array is partially initialized, the remaining elements are initialized to 0.
Incorrect
When an automatic array is partially initialized, the remaining elements are initialized to 0.
-
Question 4 of 20
4. Question
What is the output of the program
#include<stdio.h>
int main()
{
int x = 10, y = 20, z = 5, i;
i = x < y < z;
printf(“%d “, i);
return 0;
}Correct
Since x < y turns to be TRUE it is replaced by 1. Then 1 < z is compared and to be TRUE. The 1 is assigned to i.
Incorrect
Since x < y turns to be TRUE it is replaced by 1. Then 1 < z is compared and to be TRUE. The 1 is assigned to i.
-
Question 5 of 20
5. Question
Point out the error in the following program.
#include<stdio.h>
int main()
{
void v = 0;printf(“%d”, v);
return 0;
}Correct
Incorrect
-
Question 6 of 20
6. Question
In the following program how long will the for loop get executed?
#include<stdio.h>
int main()
{
int i=5;
for(;scanf(“%s”, &i); printf(“%d “, i));
return 0;
}Correct
Incorrect
-
Question 7 of 20
7. Question
Which of the declaration is correct?
Correct
int length; denotes that variable length is int(integer) data type.
char int; here int is a keyword cannot be used a variable name.
int long; here long is a keyword cannot be used a variable name.float double; here double is a keyword cannot be used a variable name.
So, the answer is int length;
Incorrect
int length; denotes that variable length is int(integer) data type.
char int; here int is a keyword cannot be used a variable name.
int long; here long is a keyword cannot be used a variable name.float double; here double is a keyword cannot be used a variable name.
So, the answer is int length;
-
Question 8 of 20
8. Question
What will be the output of the program?
#include<stdio.h>
int main()
{
int X=40;
{
int X=20;
printf(“%d “, X);
}
printf(“%d “, X);
return 0;
}Correct
In case of a conflict between a local variable and global variable, the local variable gets priority.
Incorrect
In case of a conflict between a local variable and global variable, the local variable gets priority.
-
Question 9 of 20
9. Question
Point out the error in the following program (if it is compiled with Turbo C compiler).
#include<stdio.h>
int main()
{
display();
return 0;
}
void display()
{
printf(“javatpoint.com”);
}Correct
In this program the compiler will not know that the function display() exists. So, the compiler will generate “Type mismatch in redeclaration of function display()”.
To over come this error, we have to add function prototype of function display().
Another way to overcome this error is to define the function display() before the int main(); function.#include<stdio.h>
void display(); /* function prototype */int main()
{
display();
return 0;
}
void display()
{
printf(“IndiaBIX.com”);
}
Output: javatpoint.comNote: This problem will not occur in modern compilers (this problem occurs in TurboC but not in GCC).
Incorrect
In this program the compiler will not know that the function display() exists. So, the compiler will generate “Type mismatch in redeclaration of function display()”.
To over come this error, we have to add function prototype of function display().
Another way to overcome this error is to define the function display() before the int main(); function.#include<stdio.h>
void display(); /* function prototype */int main()
{
display();
return 0;
}
void display()
{
printf(“IndiaBIX.com”);
}
Output: javatpoint.comNote: This problem will not occur in modern compilers (this problem occurs in TurboC but not in GCC).
-
Question 10 of 20
10. Question
Which of the following operations are INCORRECT?
Correct
Incorrect
-
Question 11 of 20
11. Question
Size of short integer and long integer would vary from one platform to another.
Correct
True, Depending on the operating system/compiler/system architecture you are working on, the range of data types can vary.
Incorrect
True, Depending on the operating system/compiler/system architecture you are working on, the range of data types can vary.
-
Question 12 of 20
12. Question
Which of the following correctly represents a long double constant?
Correct
6.68 is double.
6.68L is long double constant.
6.68f is float constant.
6.68LF is not allowed in c.Incorrect
6.68 is double.
6.68L is long double constant.
6.68f is float constant.
6.68LF is not allowed in c. -
Question 13 of 20
13. Question
A float is 4 bytes wide, whereas a double is 8 bytes wide.
Correct
True,
float = 4 bytes.
double = 8 bytes.Incorrect
True,
float = 4 bytes.
double = 8 bytes. -
Question 14 of 20
14. Question
Global variable are available to all functions. Does there exist a mechanism by way of which it available to some and not to others.
Correct
The only way this can be achieved is to define the variable locally in main() instead of defining it globally and then passing it to the functions which need it.
Incorrect
The only way this can be achieved is to define the variable locally in main() instead of defining it globally and then passing it to the functions which need it.
-
Question 15 of 20
15. Question
Range of double is -1.7e-38 to 1.7e+38 (in 16 bit platform – Turbo C under DOS)
Correct
False, The range of double is -1.7e-308 to 1.7e+308.
Incorrect
False, The range of double is -1.7e-308 to 1.7e+308.
-
Question 16 of 20
16. Question
A long double can be used if range of a double is not enough to accommodate a real number.
Correct
True, we can use long double; if double range is not enough.
double = 8 bytes.
long double = 10 bytes.Incorrect
True, we can use long double; if double range is not enough.
double = 8 bytes.
long double = 10 bytes. -
Question 17 of 20
17. Question
If the definition of the external variable occurs in the source file before its use in a particular function, then there is no need for an extern declaration in the function.
Correct
True, When a function is declared inside the source file, that function(local function) get a priority than the extern function. So there is no need to declare a function as extern inside the same source file.
Incorrect
True, When a function is declared inside the source file, that function(local function) get a priority than the extern function. So there is no need to declare a function as extern inside the same source file.
-
Question 18 of 20
18. Question
Is there any difference in the following declarations?
int myfun(int arr[]);
int myfun(arr[20]);Correct
Yes, we have to specify the data type of the parameter when declaring a function.
Incorrect
Yes, we have to specify the data type of the parameter when declaring a function.
-
Question 19 of 20
19. Question
Range of float id -2.25e-308 to 2.25e+308
Correct
False, The range of float is -3.4e-38 to 3.4e+38.
Incorrect
False, The range of float is -3.4e-38 to 3.4e+38.
-
Question 20 of 20
20. Question
Size of short integer and long integer can be verified using the sizeof() operator.
Correct
True, we can find the size of short integer and long integer using the sizeof() operator.
Example:#include<stdio.h>
int main()
{
short int i = 10;
long int j = 10;
printf(“short int is %d bytes., long int is %d bytes.”,
sizeof(i),sizeof(j));
return 0;
}
Output:
short int is 2 bytes.
long int is 4 bytes.Incorrect
True, we can find the size of short integer and long integer using the sizeof() operator.
Example:#include<stdio.h>
int main()
{
short int i = 10;
long int j = 10;
printf(“short int is %d bytes., long int is %d bytes.”,
sizeof(i),sizeof(j));
return 0;
}
Output:
short int is 2 bytes.
long int is 4 bytes.