Demo entry 6682391

233

   

Submitted by why on Dec 08, 2017 at 10:29
Language: C. Code size: 697 Bytes.

    #include<stdio.h>  
    #define PI 3.14159;  
    voidmain( void )  
    {  
     int f ;  
     short p, k ;  
     double c , r , s ;  
      
    /* for task 1 */  
     printf(Input  Fahrenheit: ) ;  
     scanf(%d, f ) ;  
     c = 5/9*(f-32) ;  
     printf(  \n %d (F) = %.2f (C)\n\n , f, c ) ;  
      
    /* for task 2 */  
     printf("input the radius r:");  
     scanf("%f", &r);  
     s = PI * r * r;  
     printf("\nThe acreage is %.2f\n\n",&s);  
      
    /* for task 3 */  
     printf("input hex int k, p :");  
     scanf("%x %x", &k, &p );  
     newint = (p&0xff00)|(k&0xff00)<<8;  
     printf("new int = %x\n\n",newint);  
    }  

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).