Posts

Tit Bits of Operating System

Image
  Define Operating System. ·         An  Operating System  can be defined as an  interface between user and hardware . It is responsible for the execution of all the processes, Resource Allocation, CPU management, File Management and many other tasks. ·         The purpose of an operating system is to provide an environment in which a user can execute programs in convenient and efficient manner. Difference between User and Kernel mode. User Mode Kernel Mode In user mode, the application program do not have direct access to system resources . In order to access the resources, a system call must be made.  In kernel mode, the program has direct and unrestricted access to system resources . In user mode, only single process fails if an interruption occurs.   In Kernel mode, the whole operating system migh...

Reading input in C using scanf()

Image
Reading Input in C using scanf() In C programming, `scanf()` is a commonly used function for reading input from the user. It allows you to read input of various types, including integers, floating-point numbers, characters, and strings. The Basics of scanf() The basic syntax for using `scanf()` is as follows: scanf("format string", &variable); The "format string" is a string of characters that specifies the type and format of the input you want to read, and the `&variable` argument is the address of the variable where you want to store the input. For example, if you want to read an integer input and store it in a variable named `num`, you can use the following code: int num; scanf("%d", &num); The `%d` format specifier tells `scanf()` to read an integer input, and the `&num` argument is the address of the `num` variable where the input should be stored. Reading Strings with scanf() To read a string input with `scanf()`, you can use the `%s`...