Posts

Featured post

Marks given(5 subjects) : find percentage and aggregate

Image
language:  this is a C program software used : code blocks short name : Marks given(5 subjects) : find percentage and aggregate topic: If the marks obtained by a student in five different subjects are input through the keyboard, write a program to find out the aggregate marks and percentage marks obtained by the student. Assume that the maximum marks that can be obtained by a student in each subject is 100. solution : #include<stdio.h> int main() {     int p,c,m,e,h,agr,percent;     printf("enter your marks\n");     printf("physics=");     scanf("%d",&p);     printf("chemistry=");     scanf("%d",&c);     printf("math=");     scanf("%d",&m);     printf("english=");     scanf("%d",&e);     printf("hindi=");     scanf("%d",&h);     // to calculate percent...

km in meters,feet,inches and centimeters - C program

Image
language:  this is a C program software used : code blocks short name : km in meters,feet,inches and centimeters. topic: The distance between two cities (in km) is input through the keyboard. Write a program to convert and print the distance in meters,feet,inches and centimeters. solution : #include <stdio.h> int main() {     int dist,m,cm,in;     float ft;     printf("Enter the distance between two cities(in km)= ");     scanf("%d",&dist);     printf("\nWait ....the conversion is taking place \n ");     // formula : km to m     m=dist*1000;     printf("\n in meters = %d m",m);     // formula : km to feet     ft=dist*3280.84;     printf("\n in feet = %.2f ft",ft);     // formula : km to inches     in=dist*39370;     printf("\n in in...

library fine - c program

Image
language:  this is a C program software used : code blocks short name : library fine topic: A library charges fine for every book returned late. For the first 5 days the fine is 50 paise(0.50 rupee) per day,for 6-10 days fine is one rupee per day and above 10 days fine is 5 rupees per day. If you returned the book after 30 days your membership will be canceled. Write a program to accept the number of days the member is late to return the book and display the fine or the appropriate message. solution : #include<stdio.h> void main() {     int days;     float fine;     printf("enter the number of late days : ");     scanf("%d",&days);     if(days<=30)     {         if(days<=30&&days>10)             fine=7.5+((days-10)*5);      ...