Total Pageviews

Tuesday, March 25, 2025

Operating system examination set 1

 

1.

To access the services of operating system, the interface is provided by the ___________
a) System calls
b) API
c) Library
d) Assembly instructions


2. 

What is the main function of the command interpreter?
a) to get and execute the next user-specified command
b) to provide the interface between the API and application program
c) to handle the files in operating system
d) none of the mentioned


3.

If a process fails, most operating system write the error information to a ______
a) log file
b) another running process
c) new file
d) none of the mentioned


4. 

The systems which allow only one process execution at a time, are called __________
a) uniprogramming systems
b) uniprocessing systems
c) unitasking systems
d) none of the mentioned


5.

In operating system, each process has its own __________
a) address space and global variables
b) open files
c) pending alarms, signals and signal handlers
d) all of the mentioned


6.

In Unix, Which system call creates the new process?
a) fork
b) create
c) new
d) none of the mentioned


7.

A set of processes is deadlock if __________
a) each process is blocked and will remain so forever
b) each process is terminated
c) all processes are trying to kill each other
d) none of the mentioned


8. The number of processes completed per unit time is known as __________
a) Output
b) Throughput
c) Efficiency
d) Capacity


9.

What is the degree of multiprogramming?
a) the number of processes executed per unit time
b) the number of processes in the ready queue
c) the number of processes in the I/O queue
d) the number of processes in memory



10.Which of the following do not belong to queues for processes?

a) Job Queue
b) PCB queue
c) Device Queue
d) Ready Queue

11. When the process issues an I/O request __________
a) It is placed in an I/O queue
b) It is placed in a waiting queue
c) It is placed in the ready queue
d) It is placed in the Job queue



12. What is a long-term scheduler?
a) It selects processes which have to be brought into the ready queue
b) It selects processes which have to be executed next and allocates CPU
c) It selects processes which heave to remove from memory by swapping
d) None of the mentioned


13.What is a long-term scheduler?
a) It selects processes which have to be brought into the ready queue
b) It selects processes which have to be executed next and allocates CPU
c) It selects processes which heave to remove from memory by swapping
d) None of the mentioned

14 
What is a short-term scheduler?
a) It selects which process has to be brought into the ready queue
b) It selects which process has to be executed next and allocates CPU
c) It selects which process to remove from memory by swapping
d) None of the mentioned




15.The primary distinction between the short term scheduler and the long term scheduler is 
a) The length of their queues
b) The type of processes they schedule
c) The frequency of their execution
d) None of the mentioned

16.  In a time-sharing operating system, when the time slot given to a process is completed, the process goes from the running state to the __________
a) Blocked state
b) Ready state
c) Suspended state
d) Terminated state

17.The context of a process in the PCB of a process does not contain __________
a) the value of the CPU registers
b) the process state
c) memory-management information
d) context switch time

18.Which module gives control of the CPU to the process selected by the short-term scheduler?
a) dispatcher
b) interrupt
c) scheduler
d) none of the mentioned

19.The interval from the time of submission of a process to the time of completion is termed as 
a) waiting time
b) turnaround time
c) response time
d) throughput

20. In priority scheduling algorithm 
a) CPU is allocated to the process with highest priority
b) CPU is allocated to the process with lowest priority
c) Equal priority processes can not be scheduled
d) None of the mentioned


21.Process are classified into different groups in ____________
a) shortest job scheduling algorithm
b) round robin scheduling algorithm
c) priority scheduling algorithm
d) multilevel queue scheduling algorithm


22.What are the two steps of a process execution?
a) I/O & OS Burst
b) CPU & I/O Burst
c) Memory & I/O Burst
d) OS & Memory Burst

23. What is Dispatch latency?
a) the speed of dispatching a process from running to the ready state
b) the time of dispatching a process from running to ready state and keeping the CPU idle
c) the time to stop one process and start running another one
d) none of the mentioned


24. Round robin scheduling falls under the category of ____________
a) Non-preemptive scheduling
b) Preemptive scheduling
c) All of the mentioned
d) None of the mentioned


25 The real difficulty with SJF in short term scheduling is ____________
a) it is too good an algorithm
b) knowing the length of the next CPU request
c) it is too complex to understand
d) none of the mentioned

26. An SJF algorithm is simply a priority algorithm where the priority is ____________
a) the predicted next CPU burst
b) the inverse of the predicted next CPU burst
c) the current CPU burst
d) anything the user wants

27. What is ‘Aging’?
a) keeping track of cache contents
b) keeping track of what pages are currently residing in memory
c) keeping track of how many times a given page is referenced
d) increasing the priority of jobs to ensure termination in a finite time

28. A solution to the problem of indefinite blockage of low – priority processes is ____________
a) Starvation
b) Wait queue
c) Ready queue
d) Aging

29. Which one of the following is the address generated by CPU?
a) physical address
b) absolute address
c) logical address
d) none of the mentioned

30. What is compaction?
a) a technique for overcoming internal fragmentation
b) a paging technique
c) a technique for overcoming external fragmentation
d) a technique for overcoming fatal error

31. With relocation and limit registers, each logical address must be _______ the limit register.
a) less than
b) equal to
c) greater than
d) none of the mentioned

32. When memory is divided into several fixed sized partitions, each partition may contain ________
a) exactly one process
b) at least one process
c) multiple processes at once
d) none of the mentioned

33.  In fixed size partition, the degree of multiprogramming is bounded by ___________
a) the number of partitions
b) the CPU utilization
c) the memory size
d) all of the mentioned

34. The first fit, best fit and worst fit are strategies to select a ______
a) process from a queue to put in memory
b) processor to run the next process
c) free hole from a set of available holes
d) all of the mentioned

35.  In internal fragmentation, memory is internal to a partition and ____________
a) is being used
b) is not being used
c) is always used
d) none of the mentioned

36. A solution to the problem of external fragmentation is ____________
a) compaction
b) larger memory space
c) smaller memory space
d) none of the mentioned

37. Another solution to the problem of external fragmentation problem is to ____________
a) permit the logical address space of a process to be noncontiguous
b) permit smaller processes to be allocated memory at last
c) permit larger processes to be allocated memory at last
d) all of the mentioned

38. If relocation is static and is done at assembly or load time, compaction _________
a) cannot be done
b) must be done
c) must not be done
d) can be done

39. When the memory allocated to a process is slightly larger than the process, then ____________
a) internal fragmentation occurs
b) external fragmentation occurs
c) both internal and external fragmentation occurs
d) neither internal nor external fragmentation occurs

40. Logical memory is broken into fixed-sized blocks called ________
a) frames
b) pages
c) backing store
d) none of the mentioned

41.Logical memory is broken into blocks of the same size called _________
a) frames
b) pages
c) backing store
d) none of the mentioned

42. Dispatch latency is defined as  
a)the speed of dispatching a process from running to the ready state
b)the time of dispatching a process from running to ready state and keeping the CPU idle
c)the time to stop one process and start running another one
d)none of these


43. Consider the following statements about process state transitions for a system using preemptive scheduling.(GATE 2020)

I. A running process can move to ready state.
II. A ready process can move to running state.
III. A blocked process can move to running state.
IV. A blocked process can move to ready state.

a) I, II and III only
b) II and III only
c) I, II and IV only
d) I, II, III and IV only

44. Consider a process P running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in process P moving to a non-running state (e.g., ready, blocked)?  (GATE 2024)

a)P makes a blocking system call to read a block of data from the disk
b)P tries to access a page that is in the swap space, triggering a page fault
c)An interrupt is raised by the disk to deliver data requested by some other process
d) A timer interrupt is raised by the hardware


45. Which of the following process state transitions is/are NOT possible?(GATE 2024)
a)Running to Ready
b)Waiting to Running
c)Ready to Waiting
d) Running to Terminated

46. Suppose a system contains n processes and system uses the round-robin algorithm for CPU scheduling then which data structure is best suited ready queue of the process

a)stack
b)queue
c)circular queue
d)tree

47. Where does the swap space reside ?
a)RAM
b)Disk
c)ROM
d)On-chip cache

48. Which of the following facilitates sharing of codes, data and program modules between processes?

Segments
Page table
Pages
Segment table

49. In which of the following Page replacement Algorithm making pages replacement decisions in such a manner that the total number of page faults during operation of a process is the minimum possible?

LRU Page replacement Algorithm
FIFO page replacement Algorithm
Optimal page replacement algorithm
NRU Page replacement algorithm

50. In which of the following Page replacement Policy uses the law of locality of reference as the basis for its replacement decisions?

LRU Page replacement Algorithm
FIFO page replacement Algorithm
Optimal page replacement algorithm
NRU Page replacement algorithm

51. Which of the following page replacement algorithm exhibit the stack property ?

LRU Page replacement Algorithm
FIFO page replacement Algorithm
Optimal page replacement algorithm
NRU Page replacement algorithm

52.Belady’s Anomaly occurs in which of the following page replacement algorithm?

LRU Page replacement Algorithm
FIFO page replacement Algorithm
Optimal page replacement algorithm
NRU Page replacement algorithm

53.In which of the following Algorithm where the reference bit is used to determine whether a page has been recently referenced, and some page that has not been recently referenced is replaced?

LRU Page replacement Algorithm
FIFO page replacement Algorithm
Optimal page replacement algorithm
NRU Page replacement algorithm

54. ______memory allocation avoid problems of wastage of memory and  the problems of underestimating the memory size

Dynamic memory allocation
Static memory allocation
contiguous memory allocation
None-Contiguous memory allocation

55.  ____ section is dynamically allocated memory to a process during its run time

stack
Text
Data
Heap

56. From the point of view of a particular process, the important criterion is how long it takes to execute that process. The interval from the time of submission of a process to the time of completion is the ____

Throughput
Waiting time
Turnaround time
Response time

57. It is desirable to ______.

minimize CPU utilization and throughput and to maximize turnaround time, waiting time, and response time
maximize CPU utilization and throughput and to minimize turnaround time, waiting time, and response time
maximize CPU utilization and turnaround time and to minimize throughput, waiting time, and response time
minimize waiting time and throughput and to maximize turnaround time, CPU utilization, and response time

58. Which of the following  scheduling algorithm is nonpreemptive

Shortest-Job-First Scheduling
First-Come, First-Served Scheduling
Priority Scheduling
Round-Robin Scheduling

59. Which of the following  scheduling algorithm associates with each process the length of the process’s next CPU burst

Shortest-Job-First Scheduling
First-Come, First-Served Scheduling
Priority Scheduling
Round-Robin Scheduling

60. ____ is sometimes called shortest-remaining-time-first scheduling

Round-Robin Scheduling
Preemptive SJF scheduling
Priority Scheduling
First-Come, First-Served Scheduling


ProcessArrival timeBurst time
P008
P116
p224
p332
p441

61. Calculate average waiting time using SRTF.
62. Calculate average turn around time using SRTF.
63. Calculate average response using SRTF.
64. Calculate average waiting time using RR with quantum size=2.
62. Calculate average turn around time using RR with quantum size=2..





Thursday, March 20, 2025

ISC COMPUTER SCIENCE SUGGESTION 2025

 .

Boolean algebra laws

valid invalid expression checking 

tautology

infix to postfix conversion

row major and column major address calculation

k-map 4 variable

full adder

inheritance type, inheritance interface difference

protected member vs private member

universal gate

stack push pop

tree traversal- in order, pre order, post order

tree: child, parent, sibling, , root of left sub tree ,root of right sub tree, depth, height, level, internal node ,external node

time complexity, space complexity, big o definition

linear search binary search complexity

link list deletion

RECURSION - gcd, a^i



Saturday, March 8, 2025

print series N N-1 N-2 N-3 ..............10 9 8 7 6 5 4 3 2 1 IN PROLOG

 

print series   N N-1 N-2 N-3 ..............10 9 8 7 6 5 4 3 2 1 IN PROLOG


f(X):-

    write('Enter a value'),

    nl,

    read(X),

    g(X).


g(X):-

    X > 0,

    write(X),

    nl,

    X1 is (X - 1),

    g(X1).

LOOP PROGRAMS IN PROLOG

 1. n n-1 n-2 ....5 4 3 2 1 series in prolog -CLICK

2. 1 2 3 4 5 ... 10.

3. 0 2 4 6 8 10.

4.1 3 5 7 9 11 ....

5.1 2 3 ...n

6. Factorial of a number.CLICK

7. Fibonacci series. CLICK

8.1+2+3+4....+N

9. LCM of two numbers in prolog

10. GCD of two numbers in prolog

11. prime number checking.

SMALLEST OF THREE NUMBERS IN PROLOG

 

SMALLEST OF THREE NUMBERS IN PROLOG:

smallest_three(A, B, C):-

    (A =< B),(A =< C),

    write(A);

    (B =< A),(B =< C),

    write(B);

    (C =< A),(C =< B),

    write(C).

LARGEST OF THREE NUMBERS IN PROLOG

 

LARGEST OF THREE NUMBERS IN PROLOG:

largest_three(A, B, C):-

    (A >= B),(A >= C),

    write(A);

    (B >= A),(B >= C),

    write(B);

    (C >= A),(C >= B),

    write(C).

POSITIVE NEGATIVE ZERO CHECKING IN PROLOG

 POSITIVE NEGATIVE ZERO CHECKING IN PROLOG:

positive_negative_zero(A):-

    A > 0,

    write('Positive');

    A =:= 0,

    write('Zero');

    A < 0,

    write('Negative').


ODD EVEN CHECKING IN PROLOG

 ODD EVEN CHECKING IN PROLOG:

odd_even_checking(A):-

    X is A mod 2,

    X =:= 0,

    write('Even');

    write('Odd').

LARGEST OF TWO NUMBERS IN PROLOG

 


largest(A, B):-

    A > B,

    write(A);

    write(B)

IF ELSE PROGRAM IN PROLOG

1. LARGEST OF TWO NUMBER IN PROLOG:  CLICK

2. SMALLEST OF TWO NUMBER IN PROLOG:

3. ODD EVEN CHECKING IN PROLOG :CLICK

4. POSITIVE NEGATIVE ZERO CHECKING IN PROLOG:CLICK

5. LARGEST OF THREE NUMBERS IN PROLOG: CLICK

6. SMALLEST OF TWO NUMBERS IN PROLOG:CLICK


Wednesday, March 5, 2025

SEC SAMPLE QUESTION

compare  data and information.

 input devices, output device, storage devices .

short note-LAN,MAN,WAN, BCD ,IP address,ASCII

 different network topology

Compare 1’s complement technique and 2’s complement technique.

uses, advantages ,disadvantages of ecommerce. 

 impact of Information Technology on business? 

Design circuit ,truth table

binary arithmetic-add,sub,mul,div

arithmetic in 1’s complement technique and 2’s complement technique.


 

 

Friday, February 28, 2025

Digital Circuit

 1. Basic Gates 

2. Arithmetic circuit

3. Decoder 

4. Encoder

5.Multiplexer

6. Demultiplexer

7. Flip flop and Latch - CLICK

8. counter - CLICK

9. Register  - CLICK

10.Sequential circuit  -CLICK





Tuesday, February 25, 2025

JECA 2025 QUESTION PRACTICE SET 1

 JECA 2025 QUESTION PRACTICE SET 1

Question 1:

Which disk scheduling algorithm is designed to reduce the total seek time by choosing the request that is closest to the current disk head position?

A) FCFS (First-Come, First-Served)
B) SSTF (Shortest Seek Time First)
C) SCAN
D) LOOK

Question 2:

In which of the following disk scheduling algorithms does the disk arm move from one end to the other and then reverse the direction?

A) FCFS
B) SCAN
C) C-SCAN
D) LOOK



Question 3:

Which of the following disk scheduling algorithms always moves the disk arm in a single direction?

A) FCFS
B) SCAN
C) C-SCAN
D) SSTF



Question 4:

What is the primary disadvantage of the First-Come, First-Served (FCFS) disk scheduling algorithm?

A) It can lead to high disk seek times
B) It does not guarantee fairness
C) It prioritizes critical requests
D) It causes disk head starvation

Question 5:

Which disk scheduling algorithm suffers from the problem of "starvation," where some requests may never be serviced?

A) SSTF (Shortest Seek Time First)
B) FCFS
C) SCAN
D) C-SCAN



Question 6:

Which of the following disk scheduling algorithms is most likely to cause starvation for requests far away from the current disk head position?

A) SCAN
B) LOOK
C) SSTF
D) C-SCAN



Question 7:

In the LOOK disk scheduling algorithm, the disk arm:

A) Always goes to the furthest request in one direction and then reverses
B) Moves back and forth like in SCAN but stops when there are no more requests in that direction
C) Moves only in one direction, regardless of the position of the requests
D) Chooses the request that is farthest from the current head position

Question 8:

Which disk scheduling algorithm is used in situations where the disk arm only services requests in one direction and, when reaching the end, jumps back to the starting position to continue servicing?

A) C-SCAN
B) LOOK
C) FCFS
D) SCAN

Question 9:

Which of the following disk scheduling algorithms is a modified version of SCAN where the disk arm always moves in a single direction?

A) SSTF
B) LOOK
C) C-SCAN
D) FCFS


Question 10:

Given the request queue:
Request Queue: 140, 90, 15, 200, 60, 45, 30, 180
The initial head position is at 100. Using FCFS (First-Come, First-Served) algorithm, what is the total head movement?

A) 650
B) 675
C) 720
D) 700


Question 11:

Given the request queue:
Request Queue: 140, 90, 15, 200, 60, 45, 30, 180
The initial head position is at 100. Using SSTF (Shortest Seek Time First) algorithm, what is the total head movement?

A) 350
B) 330
C) 400
D) 380



Question 12:

Consider the request queue:
Request Queue: 140, 90, 15, 200, 60, 45, 30, 180
The initial head position is at 100. Use the SCAN algorithm, and the head initially moves toward the higher numbered tracks. What is the total head movement?

A) 500
B) 450
C) 520
D) 480



Question 13:

For the request queue:
Request Queue: 140, 90, 15, 200, 60, 45, 30, 180
The initial head position is at 100. Using C-SCAN, what is the total head movement?

A) 760
B) 800
C) 780
D) 850



Question 14:

For the request queue:
Request Queue: 140, 90, 15, 200, 60, 45, 30, 180
The initial head position is at 100. Using LOOK, what is the total head movement if the head initially moves toward the lower numbered tracks?

A) 520
B) 530
C) 550
D) 570

Question 15:

Given the request queue:
Request Queue: 200, 130, 50, 80, 170, 60, 120, 150
The initial head position is at 100. Using C-LOOK, what is the total head movement?

A) 780
B) 750
C) 820
D) 770


Question 16:

Which command is used to display the current working directory in UNIX?

A) pwd
B) cd
C) ls
D) dir



Question 17:

Which command is used to change the directory in UNIX?

A) move
B) chdir
C) cd
D) dir

Question 18:

Which command in UNIX is used to list all files and directories in the current directory?

A) list
B) ls
C) dir
D) show

Question 19:

What does the command rm -r do in UNIX?

A) Removes a single file
B) Removes a directory and its contents
C) Renames a file
D) Creates a new directory



Question 20:

Which command is used to view the contents of a file in UNIX?

A) show
B) open
C) cat
D) view

Question 21:

Which command is used to display the last part of a file in UNIX?

A) head
B) tail
C) cat
D) more

Question 22:

Which command is used to find files in UNIX?

A) search
B) find
C) locate
D) grep

Question 23:

Which command is used to create a new directory in UNIX?

A) newdir
B) mkdir
C) create
D) makedir

Question 24:

Which of the following commands is used to change the file permissions in UNIX?

A) chmod
B) chown
C) setperm
D) modify



Question 25:

Which command is used to display the manual page of a command in UNIX?

A) man
B) help
C) guide
D) doc

Question 26:

Which command is used to remove a file in UNIX?

A) delete
B) remove
C) rm
D) del

Question 27:

Which command is used to count the number of lines, words, and characters in a file?

A) count
B) wc
C) lines
D) stat



Question 28:

Which command is used to display the disk usage of directories in UNIX?

A) diskusage
B) du
C) df
D) size



Question 29:

What does the command chmod 755 file.txt do?

A) Grants read and write permissions to the owner and read-only permissions to others
B) Grants full permissions to the owner and read and execute permissions to others
C) Grants full permissions to everyone
D) Removes all permissions from the owner



Question 30:

Which command is used to send a signal to a process in UNIX?

A) kill
B) terminate
C) exit
D) stop

Question 31:

Which command is used to display the current date and time in UNIX?

A) time
B) date
C) datetime
D) now



Question 32:

Which command is used to display all currently running processes in UNIX?

A) ps
B) jobs
C) process
D) tasklist



Question 33:

Which command is used to concatenate and display files in UNIX?

A) cat
B) concat
C) combine
D) join

Question 34:

Which command is used to view and search for patterns in files in UNIX?

A) search
B) grep
C) find
D) scan

Question 35:

Which command in UNIX is used to compress files?

A) zip
B) compress
C) tar
D) gzip

Question 36:

What will be the output of the following C program?

#include <stdio.h>
void main() {
    int i = 0;
    if(i++ == 0)
        printf("Hello ");
    else
        printf("World ");
}

A) Hello
B) World
C) Hello World
D) None

Question 37:

What is the result of the following C code?

int x = 5;
int y = 2;
x = x / y * y;
printf("%d", x);

A) 1
B) 2
C) 5
D) 0



Question 38:

What does the following C code print?

int x = 5;
int y = 10;
x = ++x + y++;
printf("%d %d", x, y);

A) 16 11
B) 15 11
C) 16 10
D) 15 10



Question 39:

What will be the output of this program?

#include <stdio.h>
void main() {
    int x = 1, y = 1;
    if(x++ == ++y)
        printf("Match");
    else
        printf("No Match");
}

A) Match
B) No Match
C) Compile-time error
D) Undefined behavior

Question 40:

Which of the following statements is TRUE about a union in C?

A) The members of a union share the same memory location.
B) The size of a union is the sum of the sizes of its members.
C) A union can have only one member at a time.
D) None of the above

Question 41:

What is the output of the following C program?

#include <stdio.h>
void main() {
    int i = 0;
    printf("%d ", i++);
    printf("%d ", i);
}

A) 0 1
B) 1 1
C) 1 2
D) 0 2

Question 42:

What will be the result of the following C code?

int x = 2, y = 3;
x = x ^ y;
y = x ^ y;
x = x ^ y;
printf("%d %d", x, y);

A) 2 3
B) 3 2
C) 0 0
D) Undefined behavior



Question 43:

What is the output of this program?

#include <stdio.h>
void main() {
    int arr[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
    printf("%d", *(*(arr + 1) + 1));
}

A) 4
B) 5
C) 6
D) 8

Question 44:

Which of the following statements about function pointers in C is TRUE?

A) Function pointers can point to functions with different signatures.
B) Function pointers are not allowed to be used in C.
C) A function pointer is declared using the syntax type *function_name();.
D) A function pointer stores the memory address of a variable.



Question 45

What does the following C program print?

#include <stdio.h>
void foo(int x) {
    if(x < 5) {
        x++;
        foo(x);
    }
    printf("%d ", x);
}
void main() {
    foo(0);
}

A) 1 2 3 4 5
B) 5 4 3 2 1
C) 1 2 3 4
D) 5 4 3 2

Question 46:

What is the correct syntax to declare a pointer to a function in C?

A) int *func(int x);
B) int (*func)(int x);
C) int func*(int x);
D) int *func(int x, int y);

Question 47:

What does the following program output?

#include <stdio.h>
void main() {
    int i = 10;
    while(i--) {
        printf("%d ", i);
    }
}

A) 9 8 7 6 5 4 3 2 1 0
B) 10 9 8 7 6 5 4 3 2 1
C) 9 8 7 6 5 4 3 2 1
D) Compile-time error

Question 48:

What will be the output of the following C code?

int x = 10;
int *ptr = &x;
(*ptr)++;
printf("%d", x);

A) 9
B) 10
C) 11
D) Undefined behavior



Question 49:

What is the output of the following code?

#include <stdio.h>
void main() {
    int a = 10;
    int b = 20;
    if(a = b) 
        printf("Match");
    else
        printf("No Match");
}

A) Match
B) No Match
C) Compile-time error
D) Undefined behavior



Question 50:

Which of the following is true about the sizeof operator in C?

A) It can be used with any variable type, including arrays and structures.
B) It is evaluated at runtime.
C) It can be used only with primitive data types.
D) It returns the size of a pointer to the type.



Question 51:

Which of the following is a correct declaration for a constant pointer to a constant integer in C?

A) int *const const_ptr;
B) const int *const const_ptr;
C) const int *const_ptr;
D) int const *const_ptr;



Question 52:

Which of the following functions in C can cause undefined behavior when used incorrectly?

A) malloc()
B) free()
C) strlen()
D) printf()



Question 53:

What is the output of the following code?

#include <stdio.h>
int main() {
    char *str = "Hello, World!";
    printf("%c", *(str + 7));
    return 0;
}

A) H
B) W
C) l
D) o

Question 54:

What will be the output of the following program?

#include <stdio.h>
int main() {
    int x = 0;
    switch(x) {
        case 0:
            printf("Zero");
            break;
        case 1:
            printf("One");
            break;
        default:
            printf("Default");
    }
    return 0;
}

A) Zero
B) One
C) Default
D) Compile-time error

Question 55:

What will be the output of the following code?

#include <stdio.h>
void main() {
    int i = 5;
    int *ptr = &i;
    printf("%d", ++*ptr);
}

A) 5
B) 6
C) 4
D) Undefined behavior