give an example of type casting by a simple c program

Answers were Sorted based on User's Feedback



give an example of type casting by a simple c program..

Answer / guest

[code]
#include<stdio.h>
main()
{
float a;
a = (float)15 / 3;
printf("%f\n",a);
}
[/code]

Is This Answer Correct ?    7 Yes 4 No

give an example of type casting by a simple c program..

Answer / ola

#include<stdio.h>
void main()
{
float a;
a = (float)15 / 3;
printf("%f\n",a);
}

Is This Answer Correct ?    4 Yes 4 No

Post New Answer

More C Interview Questions

Explain the use of bit fieild.

0 Answers  


C program to perform stack operation using singly linked list

3 Answers  


what does data structure mean?

8 Answers  


What is union and structure in c?

0 Answers  


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

0 Answers  






How can I make a program in c to print 'Hello' without using semicolon in the code?

9 Answers   C DAC, Practical Viva Questions,


what does keyword ‘extern’ mean in a function declaration?

1 Answers   Emerson,


what is the output of the following code? main() { int I; I=0x10+010+10; printf("x=%x",I); } give detailed reason

3 Answers  


#include<stdio.h> void main() { int =1; printf("%d%d%d",a++,++a,++a); }

3 Answers   VB,


Find the largest number from the given 2 numbers without using any loops and the conditional operator.

2 Answers  


what is the purpose of the following code, and is there any problem with the code? void fn(long* p1, long* p2) { register int x = *p1; register int y = *p2; x ^= y; y ^= x; x ^= y; *p1 = x; *p2 = y; }

1 Answers   Google,


What are the advantages and disadvantages of a heap?

0 Answers  


Categories