Posts

Showing posts from July, 2017

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...