What will be values for $a$ and $c$ after execution of the following code if $a$ is $10$, $b$ is $5$, and $c$ is $10$?
if ((a > b) && (a <= c))
a = a + 1;
else
c = c + 1;
A (run time only) is false; arrays in many languages (like C static arrays) are allocated at compile time.
C is false because an array is a linear data structure (though it stores homogeneous types).
Hence the correct statement is compile-time allocation.
In C programming, the mode 'a' in the fopen() function is used to open a file in append mode,
which allows new data to be added to the end of the file without deleting existing content.
The decimal 532.86 already represents a number with tenths and hundredths place. Correct representation remains 532.86 itself (option closest to it is 532.68 likely typo).
A **process** is a program that is currently being executed by the operating system.
However, more precisely — it is not just the program itself, but the **instance** of the program in execution, including its state, resources, and data.
When data is stored exactly as represented in memory (bit-by-bit), such files are called **binary files**.
Text files, on the other hand, store data in human-readable form (ASCII or Unicode).
lution:
- DOS was developed by **Microsoft Corporation** → Q
- P4 (Pentium 4) is a processor by **Intel Corporation** → S
- Java was developed by **Sun Microsystems** → P
- PC (Personal Computer) was introduced by **IBM** → R
Hence the correct matching:
$(1, Q), (2, S), (3, P), (4, R)$
Match List-I and List-II and select the correct group.
List-I: 1. Azim Premji 2. Narayana Murthy 3. Bill Gates 4. Ramalinga Raju
List-II: P. Microsoft Q. Wipro R. Satyam S. Infosys
Solution:
A Disk Defragmenter is a **system utility** that rearranges fragmented data on a disk
so that files are stored in contiguous sectors, improving access speed and efficiency.
Hence, it belongs to the category of **Utility Programs**.
Solution:
**ISCII (Indian Standard Code for Information Interchange)** is the encoding scheme
developed specifically for representing Indian scripts such as Devanagari, Tamil, Bengali, etc.
Consider the following C language declarations & statements.
Which statement is erroneous?
float f1 = 9.9;
float f2 = 66;
const float *ptrF1;
float * const ptrF2 = &f2;
ptrF1 = &f1;
ptrF2++;
ptrF1++;
- `const float *ptrF1;` → pointer to constant float, can move pointer, not modify value.
- `float * const ptrF2 = &f2;` → constant pointer to float, cannot change address, but can modify value.
- Statement `ptrF2++` tries to move a **constant pointer**, which is **not allowed**.
Hence, `ptrF2++` is **erroneous**.
Solution:
Operator `^` is **bitwise XOR**.
$n1 = 3 \Rightarrow 011_2$
$n2 = 6 \Rightarrow 110_2$
$n1 \oplus n2 = 101_2 = 5$
Variable `a` is declared but **not initialized**.
Using an uninitialized variable in expression `(a ^ a)` causes **undefined behavior**.
Hence, the program compiles but produces a **run-time error or unpredictable result**.
Solution:
In C, the range of `char` is from $-128$ to $127$.
When we assign $130$ to a `char`, it overflows:
$130 - 256 = -126$
Thus the value stored in `ch` is $-126$.
Output:
value of ch = -126
Solution:
`%i` reads an integer and **skips leading whitespace**, so it consumes `29`.
`%c` reads the **next character exactly as-is** (does **not** skip whitespace).
The next character after `29` is the space.
Therefore: $i=29$, $c=$ space `' '`.
Solution:
When a local variable has the same name as a global variable,
the **local variable overrides** (takes precedence over) the global one inside its block.
Thus (C) is **invalid** for C.
C was originally developed in the 1970s by Dennis Ritchie at Bell Telephone Laboratories, Inc.,
which is an outgrowth of two earlier languages, called:
Solution:
VoIP = Voice over Internet Protocol — used for calling over the internet.
All three — WhatsApp, FaceTime, and IMO — support VoIP.
So none of these options is correct.
Solution:
Statement (B) is **incorrect** — tightly coupled systems are **not** necessarily more energy-efficient than clusters; clusters can be optimized for energy efficiency.
Android devices natively support **FAT32** and **exFAT** file systems.
However, **NTFS** is not fully supported without third-party drivers or root access.
Masked ROM, EEPROM, and Flash BIOS are all types of **Read Only Memory (ROM)**.
- **Flash drive** is a type of **secondary storage (non-volatile)** device, not ROM.
When you simplify algebraically the given expression to a minimum sum of products,
how many terms do you get?
(A + B' + C + E') (A + B' + D' + E) (B' + C' + D' + E')
Solution:
Let’s analyze:
We can simplify using Boolean algebra rules.
After simplification (by K-map or expansion reduction), the minimum sum of products results in **4 terms**.
Solution:
Simplify step-by-step:
$A'CD'E + A'B'D' + ABCE + ABD$
→ Combine using absorption and distributive laws.
$A'B'D' + ABD + ACD'E$
Hence, the final simplified expression is:
Solution:
5th Generation Languages (5GL) are logic-based, AI-oriented languages that use **constraints** and **declarative problem-solving**, not step-by-step coding.
Examples: Prolog, Mercury, OPS5, etc.
- ASP and JavaScript → 4th generation or scripting languages
- SQL → 4th generation language
Hence, none of these belong to 5GL.
Solution:
String: "\nhello"
Character positions:
0:'\n' 1:'h' 2:'e' 3:'l' 4:'l' 5:'o'
→ "\nhello" + 3 points to index 3, i.e., `"llo"`
Hence it prints “llo”.
```ruby
Solution:
The function `count()` counts number of 1-bits in the binary representation of `x`.
For `a = 3`
Binary of 3 = `11`
→ Number of 1 bits = 2
Hence output = 2.
Solution:
In the **ternary operator** `(expr₁ ? expr₂ : expr₃)`,
the **data type of result** is the **common type** of `expr₂` and `expr₃`.
Here,
- `expr₁` → condition (float type, irrelevant for result type)
- `expr₂` → int
- `expr₃` → (not specified but implied same as expr₂ type logic)
When int and float are combined → **result type = float** (implicit type conversion).
Solution:
Operator precedence (from high to low in C):
`[]` > `<` > `?:` > `,`
Therefore, the highest precedence among these is **array subscript `[ ]`**.
Operator associativity in C:
- Most unary operators (!, ++, --, sizeof, etc.) → **Right to Left**
- Conditional (`?:`) → **Right to Left**
- Comma operator (`,`) → **Left to Right**
Hence, only the **comma operator** has **left-to-right** associativity.
Solution:
In C, **“else” is always paired with the nearest unmatched “if”** (no braces rule).
Here:
- The inner `if (array[i] > 0)` is the **nearest unmatched `if`** before `else`.
So, the `else` is paired with the **second (inner)** `if`.
Solution:
The **argc (argument count)** includes the program name itself.
So the arguments are:
1️⃣ "copy" (program name)
2️⃣ "file1"
3️⃣ "file2"
4️⃣ "file3"
Thus, total arguments = 4.
Solution:
- `"r+b"` or `"rb+"` → open **existing file** for both reading and writing (no truncation).
- `"w+b"` or `"wb+"` → open file for reading and writing but **creates/truncates** file.
- `"ab"` → append binary mode.
Hence, the correct mode for **existing file in read-write** is `"r+b"`.
Solution:
- `p--` → post-decrement (use then decrement)
- `--p` → pre-decrement (decrement then use)
Here, we need to **decrement p first**, then fetch the value it points to.
Hence, correct expression: `*--p`
How many times this statement will execute:
for (; *s == *t && *t != '\0'; s++, t++)
if both character pointers ‘s’ and ‘t’ point to the same string “abc”.
Solution:
C99 added these new keywords:
- `_Bool`
- `inline`
- `restrict`
- `_Complex`
- `_Imaginary`
`register` is an **old ANSI C keyword**, not added in C99.
Solution:
Valid C versions are:
- C89 (ANSI standard, 1989)
- C90 (ISO standard, 1990)
- C99, C11, C17, and C23
There is **no version called C2007 or CIX**.
The performance of modern supercomputers is measured in floating-point operations per second (FLOPS).
Fastest supercomputers operate in the range of petaflops ($10^{15}$ FLOPS).
$(p \land q) \to (p \lor q)$
This statement is always true, since whenever both $p$ and $q$ are true, $p \lor q$ is also true.
Hence, it represents a **Tautology**, not negation.
COBOL (Common Business Oriented Language) is an older programming language,
not a modern frontier technology like IoT, Data Mining, or Cloud Computing.
(interpreting “contains 1” as **exactly one** ‘1’, repetitions allowed):**
Case-1: ‘1’ in the thousand’s place → remaining $3$ places from $\{0,\dots,7\}\setminus\{1\}$ with repetition:
$7^3=343$ ways.
Case-2: ‘1’ in any one of the last three places ($3$ choices). Thousand’s place from $\{2,\dots,7\}$ ($6$ ways). Remaining two places from $\{0,\dots,7\}\setminus\{1\}$ with repetition: $7^2=49$ ways.
Total $=343+3\cdot6\cdot49=343+882
(interpreting “contains 1” as **exactly one** ‘1’, repetitions allowed):**
Case-1: ‘1’ in the thousand’s place → remaining $3$ places from $\{0,\dots,7\}\setminus\{1\}$ with repetition:
$7^3=343$ ways.
Case-2: ‘1’ in any one of the last three places ($3$ choices). Thousand’s place from $\{2,\dots,7\}$ ($6$ ways). Remaining two places from $\{0,\dots,7\}\setminus\{1\}$ with repetition: $7^2=49$ ways.
Total $=343+3\cdot6\cdot49=343+882
Which of the following group of statements are correct:
P. Mouse, Keyboard and Plotter are all input devices.
Q. Unix, Windows and Linux are all operating systems.
R. Register, Cache and Hard-disk are all memory modules.
S. Monitor, Printer and Scanner are all output devices.
$|A| = 2, |B| = 4 \Rightarrow |A \times B| = 8$
Total subsets of 8 elements = $2^8 = 256$
Subsets with less than 3 elements = $1 + 8 + 28 = 37$
Subsets with 3 or more elements = $256 - 37 = 219$
When some unidentified/unknown person/firm sends you mail in a trustworthy/lucrative way asking for sensitive bank and online payment information, this is a case of __?
Firmware is a set of permanent software instructions stored in ROM that control hardware directly.
BIOS (Basic Input Output System) is the best example of firmware.
__________ is the application of investigation and analysis techniques to gather and preserve evidence from a computing device in a way suitable for presentation in court.