C Interview Questions
Questions Answers Views Company eMail

What does the message "warning: macro replacement within a string literal" mean?

1 2946

AMMONG THE 4 STROAGE CLASSES IN C, WHICH ONE FASTEST?

HCL,

13 20697

a=0; b=(a=0)?2:3; a) What will be the value of b? why b) If in 1st stmt a=0 is replaced by -1, b=? c) If in second stmt a=0 is replaced by -1, b=?

Geometric Software,

6 13340

f() { int a=2; f1(a++); } f1(int c) { printf("%d", c); } c=?

Geometric Software,

7 10878

f1() { f(3);} f(int t) { switch(t); { case 2: c=3; case 3: c=4; case 4: c=5; case 5: c=6; default: c=0;} value of c?

Geometric Software,

5 9567

Define function ?Explain about arguments?

Geometric Software, Infosys,

2 7762

C passes By value or By reference?

Geometric Software, Infosys,

5 9496

difference between my-strcpy and strcpy ?

Geometric Software, IIM, Infosys,

3 13629

What compilation do?

Geometric Software, Infosys,

7 9509

Write a program to exchange two variaables without temp

Geometric Software,

9 11382

why java is called as a purely oops language.

TVS,

3 7618

macros and function are related in what aspect? a)recursion b)varying no of arguments c)hypochecking d)type declaration

HCL, Infosys, Microsoft,

12 33676

enum day = { jan = 1 ,feb=4, april, may} what is the value of may? a)4 b)5 c)6 d)11 e)none of the above

HCL, Wipro,

8 42119

2.main { int x,j,k; j=k=6;x=2; x=j*k; printf("%d", x);

HCL, Tech Mahindra,

9 29587

fn f(x) { if(x<=0) return; else f(x-1)+x; }

HCL,

5 16772


Post New C Questions

Un-Answered Questions { C }

What is a const pointer?

712


How can you be sure that a program follows the ANSI C standard?

1234


List a few unconditional control statement in c.

652


What do you mean by scope of a variable in c?

631


What are the different types of C instructions?

793






Explain enumerated types.

685


what is the role you expect in software industry?

1749


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

737


What is pointer to pointer in c language?

687


What is main () in c language?

693


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.

4433


What is clrscr ()?

722


What are global variables and how do you declare them?

693


Can 'this' pointer by used in the constructor?

701


Multiply an Integer Number by 2 Without Using Multiplication Operator

427