Header Ads

programming language C's question

Solve:

6.The distance between two cities in km is entered through the key board write a program to comment and print this distance in m and cm.

Ans:- # include < std io .h >
          # include < con io .h >
          void main ( )
          {
           float km, m,cm;
           clrser ( );
           print f ("enter the distance is km \n");
           scan f ("%f  ", & km );
           m =km * 1000;
           cm = m * 100;
           print f ("the distance in m = % f, the distance is cm =%f \n",m, cm);
           getch ( )
                       }          



No comments

Powered by Blogger.