Answer:
B. #
Explanation:
Every preprocessing directive must begin with the # character.
For example:
#define : Used to define a macro
#ifndef : Conditional evaluation of macro
#include : Used to include other preprocessor header file as part of the code
As we can see each of the directives begins with the # character. This is a signal to the preprocessor to interpret the subsequent keyword as a directive.
Answer:
The name of a .java file should <u>always match the name of the class inside.</u>
Explanation:
In Java programming the program written in code editor is first saved with .java extension. The name of this .java file should be same as that of the class declared inside the file.
This .java file is then compiled and converted to .class file which contains the java bytecode. This bytecode can then be executed by java virtual machine(JVM).
However it is not always necessary that name of .java files should be same as that of class inside it. The name should be same only when the class inside is declared as public.
In case it is not declared as public one can name .java file different than the actual class name.
Answer:
#include <stdio.h>
void printValues ( unsigned char *ptr, int count) // count is no of cells
{
for(int i=0; i<count; i++) {
printf("%d ", ptr[i]);
}
}
int main ( )
{
unsigned char data[ ] = { 9, 8, 7, 5, 3, 2, 1} ;
printValues( data, sizeof(data)/sizeof(data[0]) );
}
Explanation:
Remember that the sizeof() mechanism fails if a pointer to the data is passed to a function. That's why the count variable is needed in the first place.
Answer:
The function definition for this question can be given as:
Function Definition:
bool isSenior(int x ) //function
{
//function body Or function definition.
//conditional statement
//if statement
if (x >=65)
{
return true; //return value true.
}
else //else statement
{
return false; //return value false.
}
}
Explanation:
In the above function definition firstly we define a function that isSenior. This function return Boolean value that is true or false in this function we pass the value as the parameter in that function we use the if statement that check the pass value is greater then equal to 65. If the condition is true it return true.else it will return false.