June 13, 2021 in C and CPP - 1
1.2 Consider the following variable declarationUnion x{int i;float f;char c;}y; if the size of i, f and c are 2 bytes, 4 bytes and 1 byte respectively then the size of thevariable y is:-A) 1 byteB) 2 bytesC) 4 bytesD) 7 bytes
June 13, 2021 in C and CPP
1.1 The following is a programMain(){int x = 0;while(x<=10)for( ; ; )if( ++ x%10 = =0)break;printf(“x = %d”, x);}What will be the output of the above program?A) Will print x = 10B) Will give compilation errorC) Will give runtime errorD) Will print x = 20
June 13, 2021 in C and CPP
What is a Structure? Define a structure that contains the following members:i) An integer quantity called acct_noii) A character called acct_typeiii) A 40-element character array called nameiv) A floating-point quantity called balancev) A structure variable called lastpayment, of type date: defined as an integer calledmonth; an integer called day; an integer called yearvi) Include the […]