Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a c program to demonstrate Type casting in c?

Answers were Sorted based on User's Feedback



Write a c program to demonstrate Type casting in c?..

Answer / shivakumar

#include <stdio.h>

int main()
{
for ( int x = 0; x < 256; x++ ) {
/* Note the use of the int version of x to output a
number and the use
* of (char) to typecast the x into a character
which outputs the
* ASCII character that corresponds to the current
number
*/
printf( "%d = %c\n", x, (char)x );
}
getchar();

}

Is This Answer Correct ?    11 Yes 2 No

Write a c program to demonstrate Type casting in c?..

Answer / 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

More C Interview Questions

What are the valid places to have keyword “break”?

0 Answers  


Can you please explain the difference between exit() and _exit() function?

0 Answers  


say the following declaration is correct nr not. int b=a,n=0;

4 Answers   Wipro,


How do I create a directory? How do I remove a directory (and its contents)?

0 Answers  


how can make variable not in registers

1 Answers   TCS,


What is static and volatile in c?

0 Answers  


What is difference between structure and union?

0 Answers  


I have a varargs function which accepts a float parameter?

0 Answers  


post new interiew question and aptitude test papers

1 Answers  


Explain what are the different file extensions involved when programming in c?

0 Answers  


What is the difference b/w main() in C language and main() in C++.

7 Answers  


main() { printf("hello"); fork(); }

0 Answers   Wilco,


Categories