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 meant by recursion?

820


What is 2 d array in c?

740


What is hash table in c?

765


What is structure in c definition?

783


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

810


i want to switch my career from quailty assurance engineering to development kindly guide me from which programming language its better for me to start plz refer some courses or certifications too i have an experience of 1.5 yrs in QA field.Kindly guide me

1657


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

823


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

2198


Explain how can you tell whether a program was compiled using c versus c++?

763


How can I remove the leading spaces from a string?

830


When is the “void” keyword used in a function?

1143


How can I automatically locate a programs configuration files in the same directory as the executable?

840


What is the benefit of using const for declaring constants?

792


What are the main characteristics of c language describe the structure of ac program?

924


What are loops c?

796