8,327 views
1 votes
1 votes
#include<stdio.h>
int func(){
return (double)(char)5.0;
}

What will be the data type returned?

A)char

B)int

C)double

D)multiple type casting in return is illegal

1 Answer

Best answer
2 votes
2 votes

Int will be returned because the (type) operator has right to left associativity. Thus first 5.0 is typecast to char then to double and at the end return type of function is int so B should be the answer.

selected by

Related questions

0 votes
0 votes
0 answers
1
RahulVerma3 asked 5 days ago
66 views
My question is that can we use command line arguments without use of main function's parameters argc and *argv?
0 votes
0 votes
0 answers
2
RahulVerma3 asked Mar 16
102 views
I have a question that can we use command line arguments without main function arguments?int main(int argc, char argv){}
0 votes
0 votes
1 answer
3
SSR17 asked Feb 29
204 views
#include <stdio.h int main() { int i = -1; int x = (unsigned char)i; printf("%d", x); return 0; }output is 255 , but please explain how