Computer Programming & Utilization

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Catherine Halcomb
Catherine Halcomb
Community Contributor
Quizzes Created: 1443 | Total Attempts: 6,714,231
| Attempts: 646 | Questions: 30
Please wait...
Question 1 / 30
0 %
0/100
Score 0/100
1. What should be used to end every program statement in C language?

Explanation

In the C language, the semicolon (;) is used to end every program statement. It serves as a delimiter that indicates the end of a line of code. By using a semicolon, the compiler knows that the current statement is complete and can move on to the next line of code. Omitting the semicolon or using any other punctuation mark to end a statement would result in a syntax error, causing the program to fail during compilation. Therefore, the correct answer is semicolon.

Submit
Please wait...
About This Quiz
Computer Programming & Utilization - Quiz

Computer Programming and Utilization is the fundamental course on the know-how of computers and its language. Are you taking this course and need some revision material? The quiz below is one in many that are designed from your entire course work, give it a shot, and see how good you... see morewill score. Don’t forget to share it with tour classmates! see less

Personalize your quiz and earn a certificate with your name on it!
2. Which special function is ued by the C system to tell the computer where the program starts?

Explanation

The special function used by the C system to tell the computer where the program starts is "main". This function is the entry point of a C program and is executed first when the program is run. It contains the code that defines the program's logic and controls the flow of execution.

Submit
3. Any C program 

Explanation

In C programming, a program must contain at least one function. A function is a block of code that performs a specific task and can be called from other parts of the program. Without a function, there would be no executable code in the program, and it would not be able to perform any operations. Therefore, it is necessary for a C program to have at least one function.

Submit
4. Any C program 

Explanation

In C programming, a program must contain at least one function. A function is a block of code that performs a specific task. It is the fundamental building block of a C program and is necessary for the program to execute any instructions. Without a function, there would be no way to define the tasks or operations that the program should perform. Therefore, it is a requirement for any C program to have at least one function.

Submit
5. What will be the output of the program?
#include<stdio.h>
int main()
{
    int i=-3, j=2, k=0, m;
    m = ++i && ++j && ++k;
    printf("%d, %d, %d, %d\n", i, j, k, m);
    return 0;
}

Explanation

The output of the program will be -2, 3, 1, 1.

In the given code, the variable i is pre-incremented by 1, making it -2. Then, the variable j is also pre-incremented by 1, making it 3. Finally, the variable k is not incremented as the logical AND operator (&&) short-circuits when the left operand is false. Since the left operand is false (0), the right operand is not evaluated, and k remains 0.

The value of m is determined by the logical AND operation between the three variables. Since all three variables are non-zero, the result of the logical AND operation is 1.

Therefore, the final output is -2, 3, 1, 1.

Submit
6. Which of the following special symbol allowed in a variable name?

Explanation

The underscore symbol (_) is allowed in a variable name. In programming, it is commonly used to separate words in a variable name, making it more readable. For example, a variable named "my_variable" uses an underscore to separate the words "my" and "variable". The asterisk (*) is not allowed in a variable name as it is a special character used for multiplication or pointer operations. The pipeline (|) and hyphen (-) symbols are also not allowed in variable names.

Submit
7. Which of the following does not depict an arithmetic operation?

Explanation

The expression "a!=10" does not depict an arithmetic operation because it is a comparison operation, specifically checking if the value of "a" is not equal to 10. Arithmetic operations involve mathematical calculations such as addition, subtraction, multiplication, and division, which are represented by the other expressions given in the options.

Submit
8. Which of the following is used to perform computations on the entered data?

Explanation

The processor is responsible for performing computations on the entered data. It is the central unit of a computer system that executes instructions and carries out calculations. The processor receives input from the input devices, processes the data, and then sends the output to the output devices. Memory stores the data, input devices are used to enter data into the computer, and output devices display or transmit the processed data. However, the processor is specifically designed to perform computations and execute instructions on the data.

Submit
9. Associativity has no role to play unless the precedence of operator is same.

Explanation

Associativity refers to the order in which operators of the same precedence are evaluated. If the precedence of operators is the same, associativity determines whether the operators are evaluated from left to right or right to left. However, if the precedence of operators is different, associativity does not come into play. This means that associativity has no role to play unless the precedence of the operator is the same. Therefore, the given statement is true.

Submit
10. If x is an integer variable,which value will x=5/2 yield?

Explanation

When x is an integer variable, the value x=5/2 will yield 2. This is because when dividing 5 by 2, the result is 2.5. However, since x is an integer variable, it can only hold whole numbers and not decimal values. Therefore, the decimal part of 2.5 is truncated, resulting in the value 2.

Submit
11. Which of the following depicts the correct sequence of steps to run a program?

Explanation

The correct sequence of steps to run a program is to first create the program, then compile it to convert the source code into machine code, then link the compiled code with any necessary libraries or modules, and finally execute the program to run it.

Submit
12. The keyword void is a datatype in C

Explanation

In C programming, the keyword "void" is indeed a datatype. It is used to indicate that a function does not return a value. When a function is declared with the "void" datatype, it means that the function does not have a return type and does not return any value. This is commonly used when defining functions that perform certain actions or operations without needing to return a result. Therefore, the statement "The keyword void is a datatype in C" is true.

Submit
13. Which of the following correctly shows the hierarchy of Arithmetic Operator in C?

Explanation

The correct hierarchy of Arithmetic Operators in C is shown as follows: Division (/) has the highest precedence, followed by Multiplication (*), Addition (+), and Subtraction (-). This means that when multiple operators are present in an expression, division will be evaluated first, followed by multiplication, addition, and finally subtraction.

Submit
14. Who amongst the following developed the C programming language?

Explanation

Dennis Ritchie developed the C programming language.

Submit
15. What is a name having a few letters,numbers and special character_(underscore) called?

Explanation

The given correct answer for this question is "Identifiers". In programming, an identifier is a name that is used to identify a variable, function, class, or any other user-defined item. Identifiers can consist of a combination of letters, numbers, and special characters like an underscore (_). They are used to give unique names to different elements in a program and help in distinguishing them from each other.

Submit
16. Will the printf() statement print the same values for any values of a?
#include<stdio.h>
int main()
{
    float a;
    scanf("%f", &a);
    printf("%f\n", a+a+a);
    printf("%f\n", 3*a);
    return 0;
}

Explanation

The printf() statement will print the same values for any values of 'a' because both statements are performing the same calculation, which is multiplying 'a' by 3. Therefore, the output will always be the same regardless of the value of 'a'.

Submit
17. What does the unary operator "&" yield when applied to a variable?

Explanation

The unary operator "&" when applied to a variable yields the variable's address. This means that it returns the memory location where the variable is stored.

Submit
18. Sizeof() is a operator.

Explanation

The statement is true because sizeof() is indeed an operator in programming. It is used to determine the size in bytes of a data type or variable. This operator is commonly used in C and C++ programming languages to allocate memory and calculate the size of arrays, structures, and data types.

Submit
19. How many keywords are recognized by standard ANSI C?

Explanation

The standard ANSI C recognizes 32 keywords. These keywords are reserved words that have predefined meanings in the C programming language. They cannot be used as identifiers or variable names in the program.

Submit
20. In which of the following languages,the instructions are written in the form of 0s and 1s?

Explanation

Machine Language is the correct answer because it is a low-level programming language that uses binary code, represented by 0s and 1s, to provide instructions to a computer's processor. It is the most basic form of programming language and is directly understood by the computer's hardware. Assembly Language is also a low-level language, but it uses mnemonics instead of binary code. Programming Language and High-Level Language are higher-level languages that use human-readable syntax and require a compiler or interpreter to convert the code into machine language.

Submit
21. Declaration can appear anywhere in a program

Explanation

The declaration in a program must appear before the first use of the variable. If a variable is used before it is declared, the program will produce an error. Therefore, the statement "Declaration can appear anywhere in a program" is false.

Submit
22. Which of these statements does not hold true for the operator ++ and --?

Explanation

The statement "They do not require variables as their operands" is incorrect. The increment (++) and decrement (--) operators are unary operators that require a variable as their operand. They are used to increase or decrease the value of a variable by 1. It is not possible to apply these operators to expressions or constants.

Submit
23. In which order do the following evaluated?  1. Relational2. Arithmetic3.Logical4.Assignment

Explanation

The given answer, 2134, represents the order in which the operations are evaluated. According to the answer, the relational operations (1) are evaluated first, followed by arithmetic operations (2), then logical operations (3), and finally assignment operations (4). This order suggests that the relational operations have the highest precedence, followed by arithmetic, logical, and assignment operations.

Submit
24.
#include
int main()
{
    int k, num=30;
    k = (num>5 ? (num <=10 ? 100 : 200): 500);
    printf("%d\n", num);
    return 0;
}

Explanation

The code snippet declares an integer variable `k` and assigns it a value based on the value of `num`. If `num` is greater than 5 and less than or equal to 10, `k` is assigned a value of 100. If `num` is greater than 10, `k` is assigned a value of 200. If `num` is not greater than 5, `k` is assigned a value of 500. In this case, the value of `num` is 30, which is greater than 5 but not less than or equal to 10. Therefore, `k` is assigned a value of 200. The value of `num` is then printed, which is 30.

Submit
25. Which of the following is the correct order of evaluation for the below expression?
z = x + y * z / 4 % 2 - 1

Explanation

The correct order of evaluation for the expression is as follows: first, perform the multiplication ( * ) operation between y and z. Then, divide ( / ) the result by 4. Next, calculate the modulo ( % ) of the division result with 2. After that, add ( + ) the value of x to the previous result. Finally, subtract ( - ) 1 from the sum.

Submit
26. What will the output of the following code?#include<stdio.h>main(){int x=1,y=1,z;z = x++  +y;printf("%d%d",x,y);} 

Explanation

The code snippet initializes variables x and y to 1. Then, it assigns the value of the expression x++ + y to variable z. The post-increment operator (x++) increments the value of x after it is used in the expression. Therefore, z will be assigned the value of 1 + 1, which is 2. Finally, the printf statement prints the values of x and y, which are 2 and 1 respectively.

Submit
27. Identify the correct sequence of statements that swaps value of two statements.

Explanation

The correct sequence of statements that swaps the value of two variables is a=a+b; b=a-b; a=a-b;. In the first statement, the value of a is updated to a+b. In the second statement, the value of b is updated to the difference between the new value of a and the original value of b. Finally, in the third statement, the value of a is updated to the difference between the original value of a and the original value of b, effectively swapping their values.

Submit
28. Which of the following is a valid define statement?

Explanation

The correct answer is "#define MAX 200" because it follows the correct syntax for a define statement. In C programming, the define statement is used to define constants. It starts with the "#define" keyword, followed by the name of the constant (in this case "MAX"), and then the value of the constant (in this case 200). The statement should not have an equal sign or a semicolon after the value.

Submit
29. The underscore can be used anywhere in the identifier

Explanation

The underscore cannot be used anywhere in the identifier. In most programming languages, the underscore is allowed to be used in identifiers, but there are certain rules and restrictions. Generally, it can be used as a separator between words in a multi-word identifier, but it cannot be used at the beginning or end of the identifier. Additionally, some programming languages may have specific rules regarding the use of underscores in identifiers. Therefore, the statement that the underscore can be used anywhere in the identifier is false.

Submit
30. It is necessary that a header files should have a .h extension?

Explanation

Header files in C or C++ typically have a .h extension for convention and ease of identification. However, it is not necessary for a header file to have a .h extension. The extension is merely a naming convention followed by programmers to indicate that a file contains declarations or definitions of functions, variables, or other elements that are intended to be shared across multiple source files. The compiler does not enforce the requirement for a header file to have a .h extension, so it is possible to have header files with different extensions or even no extension at all.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 21, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Sep 27, 2016
    Quiz Created by
    Catherine Halcomb
Cancel
  • All
    All (30)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What should be used to end every program statement in C language?
Which special function is ued by the C system to tell the computer...
Any C program 
Any C program 
What will be the output of the program? #include<stdio.h> ...
Which of the following special symbol allowed in a variable name?
Which of the following does not depict an arithmetic operation?
Which of the following is used to perform computations on the entered...
Associativity has no role to play unless the precedence of operator is...
If x is an integer variable,which value will x=5/2 yield?
Which of the following depicts the correct sequence of steps to run a...
The keyword void is a datatype in C
Which of the following correctly shows the hierarchy of Arithmetic...
Who amongst the following developed the C programming language?
What is a name having a few letters,numbers and special...
Will the printf() statement print the same values for any...
What does the unary operator "&" yield when applied to a...
Sizeof() is a operator.
How many keywords are recognized by standard ANSI C?
In which of the following languages,the instructions are written in...
Declaration can appear anywhere in a program
Which of these statements does not hold true for the operator ++ and...
In which order do the following evaluated?  1. Relational2....
#include ...
Which of the following is the correct order of evaluation for the...
What will the output of the following...
Identify the correct sequence of statements that swaps value of two...
Which of the following is a valid define statement?
The underscore can be used anywhere in the identifier
It is necessary that a header files should have a .h extension?
Alert!

Advertisement