Explicit Conversion Program

/ C program to demonstrate explicit type casting

#include<stdio.h>
    
int main()
{
    double x = 1.2;
    
    // Explicit conversion from double to int
    int sum = (int)x + 1;
    
    printf("sum = %d", sum);
    
    return 0;
}

Comments

Popular posts from this blog