C program to find that entered year is leap year or not
A leap year is exactly divisible by 4 except for century years (years ending with 00). The century year is a leap year only if it is perfectly divisible by…
q
A leap year is exactly divisible by 4 except for century years (years ending with 00). The century year is a leap year only if it is perfectly divisible by…
#include #include void main() { int a,b,c; clrscr(); printf(“enter value of a, b & c: ”); scanf(“%d%d%d”,&a,&b,&c); if((a>b)&&(a>c)) // a is greater than b and c printf(“a is greatest”); if((b>c)&&(b>a))…
#include int main() { int number, i = 1; printf(" Enter the Number:"); scanf("%d", &number); printf("Multiplication table of %d:n ", number); printf("--------------------------n"); while (i
#include #include void main() { int gs,bs,da,ta; clrscr(); printf(“enter basic salary: ”); scanf(“%d”,&bs); da=(10*bs)/100; ta=(12*bs)/100; gs=bs+da+ta; printf(“gross salary=%d”,gs); getch(); } Output: enter basic salary: 100 gross salary=122
#include #include void main() { int n,a,r=0; clrscr(); printf(“enter any no to get its reverse: ”); scanf(“%d”,&n); while(n>=1) { a=n%10; r=r*10+a; n=n/10; } printf(“reverse=%d”,r); getch(); } Output: enter any no…
#include #include void main() { int a,b; clrscr(); printf(“enter value for a & b: ”); scanf(“%d%d”,&a,&b); a=a+b; b=a-b; a=a-b; printf(“after swapping the value of a & b: %d %d”,a,b); getch();…
#include #include void main() { int s1,s2,s3,s4,s5,sum,total=500; float per; clrscr(); printf(“enter marks of 5 subjects: ”); scanf(“%d%d%d%d%d”,&s1,&s2,&s3,&s4,&s5); sum=s1+s2+s3+s4+s5; printf(“sum=%d”,sum); per=(sum*100)/total; printf(“percentage=%f”,per); getch(); } Output: enter marks of 5 subjects: 60…
Logic:Input temperature in centigradeuse formula i.e. fahrenheit = (celsius * 9 / 5) + 32Print the value of fahrenheit #include #include void main() { float c,f; clrscr(); printf(“enter temp in centigrade: ”);…
Formula for finding simple interestsimpleinterest = (principal_amt * time * rate) / 100 #include #include void main() { int p,r,t,si; clrscr(); printf(“enter principle, Rate of interest & time to find…
#include #include void main() { int r; float pi=3.14,area,ci; clrscr(); printf(“enter radius of circle: ”); scanf(“%d”,&r); area=pi*r*r; printf(“area of circle=%f ”,area); ci=2*pi*r; printf(“circumference=%f ”,ci); getch(); } Output: enter radius of…