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

What is the difference between char array and char pointer?

0 Answers  


Write a program in c using only loops to print * * * * * *******

2 Answers   IBM,


#include<stdio.h> #include<conio.h> int main() { int a[4][4]={{5,7,5,9}, {4,6,3,1}, {2,9,0,6}}; int *p; int (*q)[4]; p=(int*)a; q=a; printf("\n%u%u",p,q); p++; q++; printf("\n%u%u",p,q); getch(); return 0; } what is the meaning of this program?

2 Answers  


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

0 Answers  


Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV

5 Answers   Accenture,


what is diff b/w huge & far & near pointer??

1 Answers   HCL,


Why ca not I do something like this?

0 Answers  


Should a function contain a return statement if it does not return a value?

0 Answers  


What is the usage of the pointer in c?

0 Answers  


i want the code for printing the output as follows 4 4 3 3 2 2 1 1 0 1 1 2 2 3 3 4 4

2 Answers  


which header file contains main() function in c?

17 Answers   Google, HCL, TCS,


what is the advantage of software development

1 Answers  


Categories