Write a c program to demonstrate Type casting in c?

Answer Posted / pinkey

#include<stdio.h>
#include<conio.h>
void main()
{
int a=5,b=4,c;
c=short(a+b);
printf("%d",c);
getch();
}

Is This Answer Correct ?    7 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is string in c language?

628


How are pointers declared in c?

602


Explain indirection?

649


Explain modulus operator. What are the restrictions of a modulus operator?

600


Can we initialize extern variable in c?

635






Why main is not a keyword in c?

652


How do you redirect a standard stream?

627


If errno contains a nonzero number, is there an error?

808


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

2802


Explain modulus operator.

597


How many loops are there in c?

583


How will you write a code for accessing the length of an array without assigning it to another variable?

617


What is a method in c?

629


What is difference between structure and union in c?

549


What is wrong in this statement?

607