1,005 views
0 votes
0 votes

1 Answer

0 votes
0 votes

1.

The usual arithmetic conversions are implicitly performed to cast their values in a common type,C uses the rule that, in all expressions except assignments, any implicit type conversions made from a lower size type to a higher size type as shown below:

usual_arithmetic_conversion

SO DOUBLE WILL BE THE ANS..

2ND PART:

CHAR=1 BYTE,INT=2/4 BYTE,FLOAT=4 BYTE,SHORT=2 BYTE

A.         IF YOU CONVERT FROM INT TO FLOAT THE VALUES CAN BE ADJUSTABLE COZ THE SIZE ARE SAME. SIMILARLY FOR OPTION C AND D.

B  .FOR THIS THE CONVERSION OF INT TO CHAR IS NOT ADJUSTABLE A INT SIZE INTO A CHAR SIZE....SO THE VALUE OF CHAR NEED TO WRAPAROUND AS PER CYCLIC NATURE OF DATA TYPES

SO OPTION B IS CORRECT.

CYCLIC NATURE IS EXPLAINED HERE

http://www.cquestions.com/2009/06/cyclic-nature-of-data-type-in-c.html

Related questions

766
views
0 answers
0 votes
garvit_vijai asked Sep 2, 2018
766 views
Please explain the output for the following program: #include<stdio.h>int main() { int i = 100; int *a = &i; float *f = (float *)a; (*f)++; printf("%d", *a); //getting some garbage value}
378
views
1 answers
1 votes
Jaspreet Kaur Bains asked Jan 27, 2018
378 views
what is the meaning of k= (char *) (i*j)it will return k =(char *) (300)
1.3k
views
2 answers
3 votes
dd asked Dec 13, 2016
1,296 views
#include <stdio.h> int main() { int A[3][4] = {{1,2,3,4}, {4,5,6,7}, {8,9,10,11} }; int *p = &A[0][0]; int *q = (int*)(&A[0]+1); int *z = (int*)(&A+1); int ... printf("%d\n",*(q - 2)); printf("%d\n",*(z - 2)); printf("%u %d\n",w,*(w+1)); }
546
views
1 answers
0 votes
Sourabh Kumar asked May 13, 2016
546 views
K is int typeK=2.0/9;What k will print? In let us c they give that k final value is 0.0But I think it's value is 0