LAB RECORD PROGRAM NO -3 Get link Facebook X Pinterest Email Other Apps November 27, 2022 3.Write a C Program to check whether a given number is even or odd. #include<stdio.h> #include <conio.h>void main() { int n; printf("Enter an integer\n"); scanf("%d", &n); if (n%2 == 0) printf("\nGiven Number %d is an Even Number.",n); else printf("\nGiven Number %d is an Odd Number.",n "); getch(); } Get link Facebook X Pinterest Email Other Apps Comments
Explicit Conversion Program December 11, 2022 / / 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; } Read more
Comments
Post a Comment