Explain union. What are its advantages?
Answer / Suhail Ahmad
A 'union' is a data structure that allows multiple variables to occupy the same memory location. Each variable can be of different data types. When one member is accessed, the other members lose their values. Union has several advantages: (1) It conserves memory by using the same storage space for multiple variables. (2) It allows efficient use of resources when dealing with data structures that require different representations at different times.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the use of #define preprocessor in c?
What is pragma c?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
how to estimate the disk access time? e.g. the time between read one byte and another byte in the disk.
write a program to display all prime numbers
Determine the code below, tell me exactly how many times is the operation sum++ performed ? for ( i = 0; i < 100; i++ ) for ( j = 100; j > 100 - i; j--) sum++;
What are different types of pointers?
Write a C program to read the internal test marks of 25 students in a class and show the number of students who have scored more than 50% in the test. Make necessary assumptions.
Write a program to generate the Fibinocci Series
IS it possible to define a zero sized array in c.if it is possible how can the elements of that array can be accessed.array index starts from zero,if it is possible to define zero sized array how can be its first element can be accesseed.
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.
In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]