# c

## Write a program in C to find the youngest person

#include<stdio.h>#include<math.h>int main(){ int r,s,a,y; printf(“n Enter age of Ganesh, Prince, Kausal”); scanf(“%d %d %d”,&r,&s,&a); if(r<s) { if(r<a) y=r; else y=a; } else { if(s<a) y=s; else y=a; } printf(“youngest is %d”,y); return 0; }

## Write a program in C to check a number that’s it reversed is equal or not

#include<stdio.h>#include<math.h>int main(){ int n,a,b,num; long int r=0; printf(“n Enter a five dight number=or less than 32766”); scanf(“%d”,&n); num=n; a=n%10; n=n/10; r=r+a*10000L; a=n%10; n=n/10; r=r+a*1000; a=n%10; n=n/10; r=r+a*100; a=n%10; n=n/10; r=r+a*10; a=n%10; r=r+a; if(r==num) printf(“n Given no. andd its reverse are equal”); else printf(“n Given no. and its reversed no. are not equal”); return 0; }

## Write a program in C to calculate the day on 1st Jan of any year

#include<stdio.h> #include<math.h>int main(){ int ld,fd,yr; long int nd,td; printf(“Enter year”); scanf(“%d”,&yr); nd=(yr-1)*365L; ld=(yr-1)/4-(yr-1)/100+(yr-1)/400; td=nd+ld; fd=td%7; if(fd==0) printf(“n Monday”); if(fd==1) printf(“n tuesday”); if(fd==2) printf(“n Wednesday”); if(fd==3) printf(” n Thrusday”); if(fd==4) printf(” n Friday”); if(fd==5) printf(” n Saturday”); if(fd==6) printf(” n Sunday”); return 0; }

## Programming in c to check whether it is leap year or not

#include<stdio.h> int main(){ int y; printf(“Enter a year”); scanf(“%d”,&y); if(y%100==0) { if(y%400==0) printf(“n leap year”); else printf(“n Not a leap year”); } else { if(y%4==0) printf(“n leap year”);elseprintf(“n Not a leap year”); } return 0;}