27 : C Program to Convert Yard to Foot

Check out the complete list of c-programs : C Program List    



This C program convers the entered measurement value in Yards to foot.

Variables :

1. yard : (Datatype float) : to hold measurement in yard entered by the user.

2. foot : (Datatype float) : to hold foot value computed.





Functions :

printf() : is used to display something on the console/screen. Format specifier %f in printf function is used to display a float variable on screen. \n is used to add a newline

scanf() : is used to fetch data inputted by the user on the console/screen using keyboard. %f in scanf is indicates that inputted text is of type float.







Formula :

foot = 3 x yard

/*
 * 1000+ C programs + tutorials
 *
 * 
 * 27_yard_to_foot_converter.c
 *
 *
 *  Created on: Oct 20, 2014
 *  Author: Code2care.org
 */

#include 
//#include 

void main() {

  float yard;
  float foot;
  

//    clrscr();

	printf(" Program to convert Yard to Foot :  ");

	printf("\n\n Enter Length in Yard  : ");
	scanf("%f", &yard);
    
    foot = (3*yard);
    
    printf("\n\n %f Yard in Foot = %f  \n",yard,foot);



//	getch();



}






Similar Questions :