Memory constrained embedded systems, IoT devices cannot have liberty to use lots of
memory. You are tasked to store the result of a NUCES-FAST student in one single variable. This can
be done using all bits of that variable in an efficient way. Write a program which prompts user to enter
the following student data and convert all this information to store in a single variable (see sample run).
Use bitwise AND, OR and SHIFT operators. Also use if-else where needed. (20 marks)
Data to Store
Binary number stored 0000001011011100010110011101011100101010100011010111100001010101
Decimal Equivalent 206138463618955349
Sample run of the program:
Enter Registration Year: 2021
Enter Campus: Islamabad
Enter Registration Number: 1724
Enter Calculus Marks = 85
Enter PF Marks = 92
Enter English Marks = 78
Enter Physics Marks = 69
Enter CGPA = 3.22
All data is stored in a record variable whose value is 206138463618955349
Here is program:
int main() {
int NUCESFAST = 10;
int* b = &NUCESFAST;
cout << &NUCESFAST;
}
Comments
Leave a comment