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?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

2138


How are pointers declared in c?

1115


Why can’t constant values be used to define an array’s initial size?

1439


Are the variables argc and argv are always local to main?

1082


Can a function argument have default value?

1210


What is the size of enum in bytes?

1136


What is an identifier?

1087


Give differences between - new and malloc() , delete and free() ?

1153


Are pointers integer?

1074


What does it mean when a pointer is used in an if statement?

1156


How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

1083


What is function what are the types of function?

1057


what value is returned to operating system after program execution?

2180


Why flag is used in c?

1181


Tell me when would you use a pointer to a function?

1124