Pages

Saturday 22 October 2011

Do while looping


Salam and Hi, shoutul nak perkenalkan do while looping

#include <stdio.h>

#include <stdlib.h>

#include <math.h>



int main ( void )

{

       double celcius;

       double fahrenheit;

       int doAgain;

       do

       {

             printf("Enter a value for celcius: \n");

             scanf("%lf",&celcius);



             fahrenheit = (9.0/5.0)*celcius+32.0;



             printf("Temperature of the fahrenheit is: %lf \n",fahrenheit);

             printf("Convert another?(0=no  otherwise - yes):");

             scanf("%d:",& doAgain);

       }

       while (doAgain);

       system ("PAUSE");

       return 0;

}


- shoutul humaira-0211-

No comments:

Post a Comment