C Interview Questions
Questions Answers Views Company eMail

how can i include my own .h file EX:- alex.h like #include, rather than #include"alex.h"

1 1533

how i m write c program 1.check prime number 2.prime number series

1 2180

main() { int a,b; printf("%d,%d",scanf("%d%d",&a,&b)); } => do u mean above program's output... =>output will be:2,whatever you enter value for b. =>because scanf is a library fn which will return how many arguements it processes, and second value you are right mr.Satya but i found my self unable to understand that for the first time scanf returns the no of successful matches but how for the second time it returns the value of 'b'.while a function should return the same 'r' value every time.

Cisco,

1 4298




write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3

ADP,

942

write a program to find lcm and hcf of two numbers??

1 3729

1. What will be the output of the following programs. a) #include Main() { Int x=4; While(x==1) { X=x-1; Printf(“%d”,x); --x; } }

CSC,

7 3982

what are threads ? why they are called light weight processes ? what is the relation between process and threads ?

1 1498

what is difference between userlevel threads and kernel level threads ?what are the trades offs between these two approaches ? what approach is most frequently used and why ?

1 3957




What is that continue statement??

4 2389

find the minimum of three values inputted by the user

3 3194

write a program that accepts 3 numbers from the user. dispaly the values in a descending order.

3 3854

Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

1145

is forign key will be unique key any table or not?

2 1721

can we declare a variable in different scopes with different data types? answer in detail

TCS,

3 2430

An array name contains base address of the array. Can we change the base address of the array?

Wipro, NMIMS,

4 9282


Post New C Questions






Un-Answered Questions { C }

pierrot's divisor program using c or c++ code

1031


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.

3317


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

1105


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

2886


a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.

2721






what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

1125


Is Exception handling possible in c language?

856


find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }

1094


please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics

2124


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

328


i want to know the procedure of qualcomm for getting a job through offcampus

1249


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

1764


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

1174


What is C language ?

813


can we change the default calling convention in c if yes than how.........?

1289