Program Statement: The company insures its drivers in the following case: If the driver is married. If the driver is unmarried , male and above 30 years of age. If the driver is unmarried , female and above 25 years of age. In all other cases the driver is not insured. If the marital status , gender, and age of the …
Read more13) Write a Program to Calculate Electricity billing amount as per given criteria.
Write a program in C to Input meter number, current reading, previous reading and consumer type (residential (r) or Commercial (c) ). Calculate billing amount as per criteria given below. Residential Commercial Units Rate Units Rate 0-100 …
Read more12) Write a program that finds and display Minimum float number from Three input Float numbers.
source file name: Min3floats.C #include <stdio.h> int main() { float a,b,c; //clrscr(); printf("\n enter 3 float numbers"); ; scanf("%f%f%f",&a,&b,&c); if(a<b && a<c) printf(" \n A is Minimum number"); else { if(b<c) printf(…
Read more14) Write a program that calculates Tax on Income . if Income >250000 then tax 5% , Income > 500000 then tax 20% and Income>1000000 then tax 30%.
source file name: incometax.C #include <stdio.h> int main() { long income,tax,taxamount; //clrscr(); printf("\n enter your income"); scanf("%ld",&income); if(income<250000) { printf(" you have no Tax "); } else { if(income>250000 && income<=500000) { taxamoun…
Read more10) Any three digit integer number is input through keyboard. Write a program to find out whether it is Armstrong number or not.
source file name: armstrong.c #include <stdio.h> int main() { int n,d1,d2,d3; int sum=0,temp; //clrscr(); printf("\n enter any 3 digit number: "); scanf("%d",&n); temp=n; d1=n%10; n=n/10; d2=n%10; n=n/10; d3=n%10; sum=(d1*d1*d1)+(d2*d2*d2)+(d3*d3*d3); if(sum==temp) printf("\n give…
Read more9) Write a program to determine whether the character entered is a upper case letter, a small case letter, a digit or a special symbol.
When a character is entered through the keyboard , write a program to determine whether the character entered is a upper case letter, a small case letter, a digit or a special symbol. ASCII values for various characters. i) A-Z 65-90 ii) a-z 97-122 i ii) 0-9 48-57 iv) special symbol 0-47, 58-64, 91-…
Read more8) Write a program to obtain reversed number of given no and to determine whether the original and reversed numbers are equal or not.
source file name: Reverseno.C If a five digit number is input through keyboard. Write a program to obtain reversed number and to determine whether the original and reversed numbers are equal or not. void main() { int n,d1,d2,d3,d4,d5; int revno,temp; //clrscr(); printf("\n enter any no \n"); scanf(&qu…
Read more7) Write a program in C to read the year in the form yyyy and check whether it is a leap year.
source file name: Leap.C void main() { int y; clrscr(); printf("\n enter any 4 digit no as year: \n"); scanf("%d",&y); if(y%4==0) printf("\n given year no is leap year"); else printf("\n given year no is not leap year"); getch(); } output:
Read more11) The marks obtained by a student in 5 different subjects are input through the keyboard. Write a program to finds grade obtained by a Student.
program statement: The marks obtained by a student in 5 different subjects are input through the keyboard. The student gets a division or grade as per the following rules: marks obtained by a student in 5 different subjects are input through the keyboard. The student gets a division or grade as per the following ru…
Read more6) Write a program to check whether the number entered is even ,odd , a positive , negative or zero.
source file name: psngodeven.C void main() { int n; clrscr(); printf("Odd or Even or +Ve or -Ve program"); printf("\n enter any number"); scanf("%d",&n); if(n%2==0) printf("\n Given no: %d is Even number",n ); else printf("\n Given no: %d is Odd number",n )…
Read moresource file name: oddeven.C void main() { int n; clrscr(); printf("Odd or Even program"); printf("\n enter any number"); scanf("%d",&n); if(n%2==0) printf("\n Given no: %d is Even number",n ); else printf("\n Given no: %d is Odd number",n ); getch(); } O…
Read more3) Write a C program that finds and display discount amount while purchasing items.
source code name: discount.C void main() { int qty,rt,amt,amtpaid; int dis=0; clrscr(); printf(" enter quantity and rate of items: \n"); scanf("%d%d",&qty,&rt); amt=qty*rt; if(amt>=1000) dis=amt*0.1; else printf("\n sorry no discount , purchase some items "); amtpaid=amt-dis; …
Read moresource name: max3.C #include<stdio.h> void main() { int a,b,c; clrscr(); printf(" enter any three numbers: \n "); scanf("%d%d%d", &a, &b, &c); if(a>b && a>c) printf(" \n maximum is A number=%d ",a); if(b>c) printf(" \n maximum is B number=%d &quo…
Read moreCode: charcase1.C void main() { char ch; clrscr(); printf("Enter any character"); scanf("%c",&ch); if(ch>=97 && ch<=122) printf("Given character is lower case"); else printf("Given character is not lower case"); getch(); } output: Ente…
Read moreCode: Profit.C void main() { int cp,sp,profit,loss; clrscr(); printf("enter cost and selling price"); scanf("%d %d ",&cp,&sp); if(sp>cp) { profit=sp-cp; printf("Profit=%d",profit); } else { loss=cp-sp; printf("loss=%d",loss); } getch(); …
Read more