Java C Basics Test 2 - 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 2 – Java C Basics Question and Answers. Test your JAVA C Basics Fundamentals with our free Java C Basics online Quiz. Java C Basics Test 2 Question and Answers 2024. Java online Test Quiz 2. Java C Basics Quiz 2 Free Mock Test 2024. Java C Basics Quiz 2 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 2 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
How would you round off a value from 1.66 to 2.0?
Correct
Incorrect
-
Question 2 of 20
2. Question
By default a real number is treated as a
Correct
In computing, real number often refers to non-complex floating-point numbers. It include both rational numbers, such as 42 and 3/4, and irrational numbers such as pi = 3.14159265…
When the accuracy of the floating point number is insufficient, we can use thedouble to define the number. The double is same as float but with longer precision and takes double space (8 bytes) than float.
To extend the precision further we can use long double which occupies 10 bytes of memory space.Incorrect
In computing, real number often refers to non-complex floating-point numbers. It include both rational numbers, such as 42 and 3/4, and irrational numbers such as pi = 3.14159265…
When the accuracy of the floating point number is insufficient, we can use thedouble to define the number. The double is same as float but with longer precision and takes double space (8 bytes) than float.
To extend the precision further we can use long double which occupies 10 bytes of memory space. -
Question 3 of 20
3. Question
Which of the following is not user defined data type?
1 : struct book
{
char name[10];
float price;
int pages;
};
2 : long int l = 2.35;
3 : enum day {Sun, Mon, Tue, Wed};Correct
C data types classification are
1. Primary data types
1. int
2. char
3. float
4. double
5. void
2. Secondary data types (or) User-defined data type
1. Array
2. Pointer
3. Structure
4. Union
5. Enum
So, clearly long int l = 2.35; is not User-defined data type.
(i.e.long int l = 2.35; is the answer.)Incorrect
C data types classification are
1. Primary data types
1. int
2. char
3. float
4. double
5. void
2. Secondary data types (or) User-defined data type
1. Array
2. Pointer
3. Structure
4. Union
5. Enum
So, clearly long int l = 2.35; is not User-defined data type.
(i.e.long int l = 2.35; is the answer.) -
Question 4 of 20
4. Question
What are the types of linkages?
Correct
Incorrect
-
Question 5 of 20
5. Question
Is there any difference between following declarations?
1 : extern int fun();
2 : int fun();Correct
extern int fun(); declaration in C is to indicate the existence of a global function and it is defined externally to the current module or in another file.
int fun(); declaration in C is to indicate the existence of a function inside the current module or in the same file.Incorrect
extern int fun(); declaration in C is to indicate the existence of a global function and it is defined externally to the current module or in another file.
int fun(); declaration in C is to indicate the existence of a function inside the current module or in the same file. -
Question 6 of 20
6. Question
Which of the following special symbol allowed in a variable name?
Correct
Variable names in C are made up of letters (upper and lower case) and digits. The underscore character (“_”) is also permitted. Names must not begin with a digit.
Incorrect
Variable names in C are made up of letters (upper and lower case) and digits. The underscore character (“_”) is also permitted. Names must not begin with a digit.
-
Question 7 of 20
7. Question
Identify which of the following are declarations
1 : extern int x;
2 : float square ( float x ) { … }
3 : double pow(double, double);Correct
extern int x; – is an external variable declaration.
double pow(double, double); – is a function prototype declaration.
Therefore, 1 and 3 are declarations. 2 is definition.Incorrect
extern int x; – is an external variable declaration.
double pow(double, double); – is a function prototype declaration.
Therefore, 1 and 3 are declarations. 2 is definition. -
Question 8 of 20
8. Question
Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
Correct
Incorrect
-
Question 9 of 20
9. Question
Is the following statement a declaration or definition?
extern int i;Correct
Declaring is the way a programmer tells the compiler to expect a particular type, be it a variable, class/struct/union type, a function type (prototype) or a particular object instance. (ie. extern int i)
Incorrect
Declaring is the way a programmer tells the compiler to expect a particular type, be it a variable, class/struct/union type, a function type (prototype) or a particular object instance. (ie. extern int i)
-
Question 10 of 20
10. Question
In the following program where is the variable a getting defined and where it is getting declared?
#include<stdio.h>
int main()
{
extern int a;
printf(“%d “, a);
return 0;
}
int a=20;Correct
– During declaration we tell the datatype of the Variable.
– During definition the value is initialized.Incorrect
– During declaration we tell the datatype of the Variable.
– During definition the value is initialized. -
Question 11 of 20
11. Question
What will be output if you will compile and execute the following c code?
#include<stdio.h>
int main(){
int a=sizeof(a);
a=modify(a);
printf(“%d”,a);
return 0;
}
int modify(int x){
int y=3;
_AX=x+y;
return;
}Correct
_AX is register pseudo variable. It stores return type of function.
Incorrect
_AX is register pseudo variable. It stores return type of function.
-
Question 12 of 20
12. Question
Which of the following is a two-dimensional array?
Correct
Incorrect
-
Question 13 of 20
13. Question
What will be output if you will compile and execute the following c code?
#include<stdio.h>
int main(){
float f;
f=3/2;
printf(“%f”,f);
return 0;
}Correct
In the following expression:
f=3/2 both 3 and 2 are integer constant hence its result will also be an integer constant i.e. 1.Incorrect
In the following expression:
f=3/2 both 3 and 2 are integer constant hence its result will also be an integer constant i.e. 1. -
Question 14 of 20
14. Question
What will be output if you will compile and execute the following c code?
#include<stdio.h>
int main(){
int array[2][2][3]={0,1,2,3,4,5,6,7,8,9,10,11};
printf(“%d”,array[1][0][2]);
return 0;
}Correct
array[1][0][2] means 1*(2*3)+0*(3)+3=9th element of array starting from zero i.e. 8.
Incorrect
array[1][0][2] means 1*(2*3)+0*(3)+3=9th element of array starting from zero i.e. 8.
-
Question 15 of 20
15. Question
What is the index number of the last element of an array with 29 elements?
Correct
Incorrect
-
Question 16 of 20
16. Question
Which of the following correctly declares an array?
Correct
Incorrect
-
Question 17 of 20
17. Question
What will be output if you will compile and execute the following c code?
#include<stdio.h>
int main(){
int a=15,b=10,c=5;
if(a>b>c )
printf(“Trre”);
else
printf(“False”);
return 0;
}
Correct
Incorrect
-
Question 18 of 20
18. Question
What will be output if you will compile and execute the following c code?
#define PRINT printf(“c”);printf(“c++”);
int main(){
float a=5.5;
if(a==5.5)
PRINT
else
printf(“Not equal”);
return 0;
}Correct
First see intermediate file:
try.c 1:
try.c 2: int main(){
try.c 3: float a=5.5;
try.c 4: if(a==5.5)
try.c 5: printf(“c”);printf(“c++”);
try.c 6: else
try.c 7: printf(“Not equal”);
try.c 8: }
try.c 9: return 0;
try.c 10:If there are more than one statement in if block then it is necessary to write inside the { } otherwise it will show compiler error: misplaced else
Incorrect
First see intermediate file:
try.c 1:
try.c 2: int main(){
try.c 3: float a=5.5;
try.c 4: if(a==5.5)
try.c 5: printf(“c”);printf(“c++”);
try.c 6: else
try.c 7: printf(“Not equal”);
try.c 8: }
try.c 9: return 0;
try.c 10:If there are more than one statement in if block then it is necessary to write inside the { } otherwise it will show compiler error: misplaced else
-
Question 19 of 20
19. Question
Which of the following gives the memory address of the first element in array foo, an array with 100 elements?
Correct
Incorrect
-
Question 20 of 20
20. Question
Which of the following correctly accesses the seventh element stored in foo, an array with 100 elements?
Correct
Incorrect