Type Casting in C

Advertisements

Prev Tutorial Next Tutorial

Type Casting in C Programming

Type casting is process to convert a variable from one data type to another data type. For example if we want to store a integer value in a float variable then we need to typecast integer into float.

Type Casting

Example Type Casting in C

#include <stdio.h>
#include <conio.h>

void main()
{
int a,b;
float sum;
clrscr();
printf("Enter two no. ");
scanf("%d%d",&a,&b);
sum=a+b;
printf("Sum: %f",sum);
getch();
}

Output

Type Casting in c
Prev Tutorial Next Tutorial

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements