3 views
23 Jan 2026
Create a union containing an int, float, or char array. Store a value in one member, then read it from the other. What value will be returned, and why (concept of memory overlap)?...
3 views
23 Jan 2026
Const int, const pointer, pointer to const - declare all three. Then try modifying them and see which modification is allowed and which one gives a compile error....
2 views
23 Jan 2026
Use a normal variable and a register variable in a loop. Increment both by 1 million. Measure the time difference (practical experiment).
...
2 views
23 Jan 2026
Create a global variable 'count' with the value 10. Create a local variable 'count' in the function with the value 5. Show the difference by printing both values inside and outside the function....
2 views
23 Jan 2026
Make a list of 7 days of the week. Input the number (0-6) from the user and print the corresponding day name. Error message on invalid number. Show the internally integer values of the enum....
2 views
23 Jan 2026
Cast the float value 9.7 to a float in different ways: implicit, explicit, using floor, using cel. What will be the result in each case and why?...
2 views
23 Jan 2026
By printing the size of different datatypes (char, int, float, double, long, pointers). Then create array of each type and verify that array size = element_count * sizeof(type)....
2 views
23 Jan 2026
Create nested blocks (outer, middle, inner). Use the same variable name 'x' in all three. Print the value at each level and understand which value is coming from which scope....
3 views
23 Jan 2026
Create a function that counts the number of times it has been called on each call. Implement it using a static variable. Call main 10 times and display the count....
2 views
23 Jan 2026
Two integers need to be swapped without using a third variable. Use three different methods: arithmetic, XOR, and one more trick. Explain the logic behind each method....