C Interview Questions
Questions Answers Views Company eMail

Discuss similarities and differences of Multiprogramming OS and multiprocessing OS?

TCS,

4 9017

can we declare a function inside the structure? ex: struct book { int pages; float price; int library(int,float); }b; is the above declaration correct? as it has function declaration?

2 4864

inline function is there in c language?

4 6134

what is an inline function?

TCS,

2 3472

where do we use structure pointer?

1 2695

where do we use volatile keyword?

1 3258

what is constant pointer?

3 4385

what is the use of bitfields & where do we use them?

2 3092

code for bubble sort?

1 2821

code for selection sort?

1 3151

code for quick sort?

1538

code for concatination of 2 strings with out using library functions?

3 4607

how 2 compile & execute c program with out using editor?

HP,

2 8694

You have an int array with n elements and a structure with three int members. ie struct No { unsigned int no1; unsigned int no2; unsigned int no3; }; Point1.Lets say 1 byte in the array element is represented like this - 1st 3 bits from LSB is one number, next 2 bits are 2nd no and last 3 bits are 3rd no. Now write a function, struct No* ExtractNos(unsigned int *, int count) which extracts each byte from array and converts LSByte in the order mentioned in point1.and save it the structure no1, no2, no3. in the function struct No* ExtractNos(unsigned int *, int count), first parameter points to the base address of array and second parameter says the no of elements in the array. For example: if your array LSB is Hex F7 then result no1 = 7, no2 = 2, no3 = 7. In the same way convert all the elements from the array and save the result in array of structure.

Qualcomm,

2 4485

wat s the meaning of (int *)p +4;

2 6063


Post New C Questions

Un-Answered Questions { C }

What tq means in chat?

504


What is bash c?

494


Array is an lvalue or not?

551


Can a variable be both constant and volatile?

500


Difference between strcpy() and memcpy() function?

609






What are the types of pointers in c?

477


what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

587


Explain union. What are its advantages?

550


int i=10; printf("%d %d %d", i, i=20, i);

950


How can I sort a linked list?

576


The OS is a program that uses various data structures. Like all programs in execution, you can determine the performance and other behavior of the OS by inspecting its state - the values stored in its data structures. In this part of the assignment, we study some aspects of the organization and behavior of a Linux system by observing values of kernel data structures exposed through the /proc virtual file system. The /proc virtual file system: Linux uses the /proc file system to collect information from kernel data structures. The /proc implementation provided with Linux can read many different kernel data structures. If you cd to /proc on a Linux machine, you will see a number of files and directories at that location. Files in this directory subtree each corresponds to some kernel data structure. The subdirectories with numeric names contain virtual files with information about the process whose process ID is the same as the directory name. Files in /proc can be read like ordinary ASCII files. You can open each file and read it using library routines such as fgets() or fscanf(). The proc (5) manual page explains the virtual files and their content available through the /proc file system. Requirements in detail: In this part, you are asked to write a program to report the behavior of the Linux kernel. Your program should run in two different versions. The default version should print the following values on stdout: • Processor type • Kernel version • The amount of memory configured into this computer • Amount of time since the system was last booted A second version of the program should run continuously and print lists of the following dynamic values (each value in the lists is the average over a specified interval): • The percentage of time the processor(s) spend in user mode, system mode, and the percentage of time the processor(s) are idle • The amount and percentage of available (or free) memory • The rate (number of sectors per second) of disk read/write in the system • The rate (number per second) of context switches in the kernel • The rate (number per second) of process creations in the system If your program (compiled executable) is called proc_parse, running it without any parameter should print out information required for the first version. Running it with two parameters "proc_parse " should print out information required for the second version. read_rate represents the time interval between two consecutive reads on the /proc file system. printout_rate indicates the time interval over which the average values should be calculated. Both read_rate and printout_rate are in seconds. For instance, proc_parse 2 60 should read kernel data structures once every two seconds. It should then print out averaged kernel statistics once a minute (average of 30 samples). The second version of your program doesn't need to terminate.

4250


How can I implement sets or arrays of bits?

540


how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

589


show how link list can be used to repersent the following polynomial i) 5x+2

1600


How can I read data from data files with particular formats?

542