C Interview Questions
Questions Answers Views Company eMail

Write a routine that prints out a 2-D array in spiral order!

Lucent,

1 5457

what is a far pointer

ITI, ABB, TCS, Steel Plant, DRDO, Vivo Mobiles, Maruti Suzuki, Toyota,

12 25812

Write a program to compare two strings without using the strcmp() function

Accenture, Arba Minch University,

42 100665




what is the difference between const char *p, char const *p, const char* const p

Verizon, CTS, Aricent, Accenture, Geometric Software, Point Cross,

5 44050

Write a program to interchange two variables without using the third variable?

Infotech, Accenture, College School Exams Tests,

17 25855

What is the output of the program given below #include main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

TCS, ADITI, Student,

21 16881

What is the output of the following program #include main() { int i=0; fork(); printf("%d",i++); fork(); printf("%d",i++); fork(); wait(); }

Adobe, ADITI,

8 11113

What is the memory allocated by the following definition ? int (*x)[10];

Wipro, ADITI,

4 10946




What is the memory allocated by the following definition ? int (*x)();

ADITI,

2 6150

What is the output for the program given below typedef enum grade{GOOD,BAD,WORST,}BAD; main() { BAD g1; g1=1; printf("%d",g1); }

ADITI,

4 5752

Give the output for the following program. #define STYLE1 char main() { typedef char STYLE2; STYLE1 x; STYLE2 y; clrscr(); x=255; y=255; printf("%d %d\n",x,y); }

ADITI,

2 4261

#ifdef TRUE int I=0; #endif main() { int j=0; printf("%d %d\n",i,j); }

ADITI,

3 4426

What is the output for the following program #include main() { char a[5][5],flag; a[0][0]='A'; flag=((a==*a)&&(*a==a[0])); printf("%d\n",flag); }

Wipro, ADITI,

5 5468

HOW DO YOU HANDLE EXCEPTIONS IN C?

AppLabs,

2 4500

WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c file management?

Deltech, IBM, 3D PLM, Code Studio,

28 66460


Post New C Questions






Un-Answered Questions { C }

how to construct a simulator keeping the logical boolean gates in c

822


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

1989


how to find anagram without using string functions using only loops in c programming

1907


Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.

3572


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

1820






write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

688


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.

3242


5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.

821


how logic is used

739


Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.

186


what is a function method?give example?

1094


how to create duplicate link list using C???

1266


Explain output of printf("Hello World"-'A'+'B'); ?

190


write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

10356


how to build a exercise findig min number of e heap with list imlemented?

771