Base conversion

Aim: Base conversion of a number using C. #include<stdio.h> #include<conio.h> #include<string.h> void main() { unsigned dec,t,d,i; char bin[20],oct[15],hex[5]; printf("Enter a decimal number : "); scanf("%u",&dec); t=dec; i=0; do { d=t%2;…

Continue ReadingBase conversion

Leap Year

Aim: Check whether a given year is a leap year or not using C. #include<stdio.h> #include<conio.h> void main() { int year; printf("Enter an year : "); scanf("%d",&year); if(year%4==0 && year%100!=0…

Continue ReadingLeap Year