C Interview Questions
Questions Answers Views Company eMail

Tell me a C program to display the following Output? 1 1 1 1 1 2 2 2 2 3 3 3 4 4 5

3 2554

Output for following program using for loop only * * * * * * * * * * * * * * *

3 2614

program for following output using for loop? 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5

Infosys, Aptech,

8 13872




program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5

Infosys,

8 5522

simple program of graphics and their output display

Elysium,

730

If the static variable is declared as global, will it be same as extern?

Samsung,

1 4743

How to print India by nested loop? I IN IND INDI INDIA

Wipro, NIIT,

3 5734

simple program of graphics and thier outpu display with a want what is out put of graohics in c language

CSC, HCL,

1 1798




A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

HCL,

909

plz let me know how to become a telecom protocol tester. thank you.

987

If input is 123 then how to print 100 and 20 and 3 seperately?

4 3754

An entire structure variable can be assigned to another structure variable if __________

TCS, Wipro, Sasken, Tech Mahindra,

3 7307

Give the logic for this #include #include void main() { clrscr(); int a=10,b; b=++a + ++a; printf("%d", b); getch(); } Output: 24......How?

Accenture,

2 3216

in malloc and calloc which one is fast and why?

1 3641

Difference between C and Embedded C?

1 2796


Post New C Questions






Un-Answered Questions { C }

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.

3571


write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34

845


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

1064


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

1989


Topics: Structures, Arrays, Searching and Sorting Assume there is a small mobile computer device including a hard disk and a slot for a memory card. The device shall be used to backup photos e.g. during holiday. Every time a memory card is connected all photos of the card are copied into a new folder automatically. And your task is to develop some basic controlling software to show, add, remove, search and sort the directories of photos. Step by Step Implementation 1.Define two symbolic constants, one to hold the total volume of the disk (e.g. VOLUME) and another one to hold the number of entries the files system of the device can handle (MAXFOLD). 2.Define a new structure data type named DATE to store a date consisting of year, month and day as unsigned values. 3.Define an other structure data type FOLDER to store the information of one folder of photos: ◦A title as character array of appropriate length ◦The location (event) the photos are taken as character array of appropriate length ◦The date of the day the photos are copied to the disk using the just defined data type DATE ◦The number of photos as natural number ◦And the size of the folder in MB as floating point value 4.Define the following global variables and initialise them: ◦disk as an array with MAXFOLD elements of data type FOLDER ◦folders as natural value to count the number of folders currently stored at the disk (valid elements in the array) TEST: Now you should be able to compile the code the first time without any warning or error. In the menu only "p" to print and "q" to quit will work!. 5.Now complete the functions given by their prototype: float freeSpace ();The function has to calculate the sum of the size component of all elements currently stored in the disk array. The function shall return the free space of the disk by the difference between the available total volume and the calculated sum. TEST: To test this function you only need to uncomment printing the "statusline" at the function actionmenu(). Compare the calculated value with a manual calculation of the example values given above. unsigned isBefore (DATE, DATE);The function checks if one date is before the other. There are 3 different possibilities which have to be handled. Imagine for example these 3 different combinations of values: ◦2010-01-01 : 2010-01-02 ◦2010-01-01 : 2010-02-01 ◦2010-01-01 : 2009-01-01 The function shall just return the result of the comparison. unsigned isEqual (DATE, DATE);The function checks if one date is equal to the other, all components have to be compared. The function shall just return the result of the comparison. int findByDate (DATE);As the array is should be kept in order (sorted by date) implement a binary search for a folder by its date here. You need only to adapt the binary search we used in the exercise. Use the 2 comparing functions above where appropriate. The function shall return the index of the element which was found or -1. TEST: Now you can try searching a folder by date via the "s" in the menu. Activate the corresponding part in the main function. int isSpaceLeft (FOLDER);This function compares the free space of the disk with the size of folder given with the parameter list. The function shall return 1 if there is enough space to add the folder, otherwise 0 (just the result of the comparison). void SortByDate ();This function shall implement the InsertionSort using the component date as key. Use the provided algorithm/souce code of the exercise as template. If you need a comparison between dates, use the function isBefore you have written again. void addFolder (FOLDER);The function has to check if the disk has additional capacities to add the new folder (number of folders and space left). If at least one of these conditions is false print an error message and return -1. Else there has to be added an other test to avoid 2 folder elements with the same date (use the findByDate function here. If there is no folder with the new date simply attach the new folder at the end of the array and call the sorting algorithm afterwards to keep the order in the array. TEST: Now you can try to add a folder via the "a" in the menu. Activate the corresponding part in the main function. void delDir (int);This function removes one element of the disk array. The input parameter contains the index of the element to delete. Deletion can simply be done by moving all elements at the right one to the left (overwriting the element to delete. The function may get a -1. This has to be checked first (certainly there is nothing to delete then!) Don't forget to decrement the counter of elements at the end. TEST: Now you can try to remove a folder by date via the "r" in the menu. Activate the corresponding part in the main function. unsigned findAllOfLocation(char[], FOLDER[]);This is an optional additional task: The function shall find all elements with the given value for the component location (first input parameter). The array elements which are found have to be added to the FOLDER array (second input parameter). As this parameter is an array we can use the result later in the main function. There kernel of function implements a modified linear search on the disk array (it does not stop if one element is found bat continues search until the location of all elements is checked). The finally function shall return the number of elements found in the disk array. TEST: Now you can try to add a folder by date via the "l" in the menu. Activate the corresponding part in the main function.

1179






write a program to find out prime number using sieve case?

850


how to write optimum code to divide a 50 digit number with a 25 digit number??

1959


write a c program in such a way that if we enter the today date the output should be next day's date.

924


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

1455


p*=(++q)++*--p when p=q=1 while(q<=6)

489


#include { printf("Hello"); } how compile time affects when we add additional header file .

676


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

4339


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

916


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

1206


can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

685