-
Bit fields memory aligment with unsigned int, short int.
I have a structure.
struct {
int a : 8;
int b : 10;
int c : 12;
int d : 4;
int e : 3;
int : 0;
int f : 1;
char g;
} A;
The size of bitfields memory is 48bits.
The size of structure should be 4+4+1 bytes = 9 bytes. What about the memory for variable g. why memory for g is not allocated separately.... -
All Possible Combinations Using Coins
Write a pseudo code in which using coins of Rs 1 Rs., 2 Rs., 5 Rs. and 10 Rs, find all possible combination of to pay X amount. X can be any amount. For Example, There are 3 ways to give change for Rs. 4 using coins mentioned above:
1+1+1+1
1+1+2
2+2
-
Insert New Value to Sorted Array
Write a pseudo code to insert new value x to an already sorted array of 1,000,000,000 numbers at its appropriate position in an optimum way?
-
C based on Data Structure
Implement grep command in C using binary tree
-
Find a Solution in C, C++, C#
Given a list of integers (more than 1 million) find out how many ways there of selecting two of therm that add up to 0.
-
Farm Grid of Cells Arrangement - Asked at Practo
On a farm divided into a grid of cells, every cell either has grass on it or is empty. If two adjacent cells have grass, they will belong to a common field. The common field extends in all directions to all adjacent cells with grass. So, if cell A is adjacent to cell B and cell B is adjacent to cell C, and all three have grass, then they all lie in the same field. If a cell with grass has no adjacent...
-
What is the difference between loop and function recursion?
Loop doesnot allocate memory , read more : http://forum.litindia.in/forums/topic/what-is-the-difference-between-loop-and-function-recursion/
-
-
Write a simple program to organize student marks ?
The ID (numeric part) and marks of each student can be entered. Once all the data is entered (with no sorting), the list of IDs and marks can be output in forward or reverse order (i.e. according to array index or the order you entered the data). Set a maximum number of 10 students to be entered including your own ID. Use only integer array(s). Show the output of the array in both orders.
-
-
C program to compare two text files
Hii All,
i am a begginer at c programming in the first semetser of study, and i am trying to doing my project what is:
Diff — The program should compare two text files and list the differences, i.e. lines and columns of the beginning and the end of a given difference.
i dont know how to start or what to do with this, please anyhelp :)
thank you -
-
Program
Write a program that asks a user to type in their name, sex, age, roll number and store them!
The program should then print the information the user entered
(Hints: use character arrays for name, sex) -
-
Stop Watch
I want code for stop watch in c c++ & java.
-
Cprintf vs printf
cprintf is defined to send formatted output to the text window on the screen. And printf directs its output to the stdout. What is the difference between stdout and a text window then? Does the screen serve differently while using cprintf and printf? Please explain
-
C Compiler Dependency
Some Questions Answers are compiler dependent..so correct it, as in my test i observed the sizeof int is 2 bytes which was in 16bit compiler like turbo. Now world has moved to 32 bits, even 64 bits will coming near soon, so change ur test ans....
-
Want C program for this please.
I need the code for this... plz help me out...
Search c keyword;
1) The program will ask user to enter a file name (a C source file )
2) software will open file and search C language keywords in file
3) it will print keywords and their count after traversing through whole file in following format;
IF 1o
WHILE 7
INT 4
FLOAT 5
The program... -
C program using loop and array
Write a C program using arrays and any loop statements that asks the user to enter the number of students. For each student, enter the number of courses. The user should enter the students ID number and the marks for each course. Compute and display the total and average of the students marks.
Sample Output:
Enter the number of students: 2
Enter Student ID no. 1: 082367 -
File handling in c++
what is the difference between the two statements:
file.write( reinterpret_cast(&pers), sizeof(pers) );
file1.write( (char*) & pers, sizeof(pers );
C Interview Questions
Ans