Dear guys,
I get stuck in a basic problem that is often overlooked.
Like this , I can write code in such way.

         1.#include"stdio.h"
         2.void main#void#{
         3.    double x;
         4.    scanf#"%f",&x#;
         5.    printf#"%f",x#;
         6.      } 

When I input a number like 3.0 ,however the result is a minus number.
I don't konw why ,anybody can help me?

use %lf in scanf to read doubles
also use parentheses instead of using the sharp symbol for the argument of main, scanf and printf

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.