#include main() { Float a,b,sum; a=3.087; sum=a+b; printf("sum=%f",sum); }

Actully i was getting the ans as 11 so.iwas having the doubt that if we dont give the value of b will it consider itself n how

Replies

  • Kaustubh Katdare
    Kaustubh Katdare

    #-Link-Snipped-#  - I'm not sure what you're trying to do. If you haven't define 'b', it's not going to add up to a.

    The output of the following program -

    #include

    main() 

    { 

        float a,b,sum; a=3.087; 

        sum=a+b; 

        printf("sum=%f",sum); 

        return 0;

    }

    is 3.087000 

    I'm not sure why are you getting 11. Did you write the entire program? Could you check and post again? 

  • Devika Tulsidas
    Devika Tulsidas

    Sorry im getting 3.087000.i dont know what mistake i have done that time

  • Jayt aw
    Jayt aw

     try to initialize b variable with 0, may be junk values causing the problem.

You are reading an archived discussion.

Related Posts

Books not based on basics only but some advanced concepts in VLSI.
I have 67% in -12th if I exempt my additional subject, while placement do they ask for all subject marks? Or the marks you scored in the respective subjects you...
my friends told me that its going to be long hours you will feel tired and all that's why this question.
The resume i have uploaded is outdated.I will like to upload my updated resume which would be more beneficial for me
 Machine Design claims: MDO is a design field integrating various fields of engineering into a single unit. It finds a multitude of applications in today’s world, including aerospace, automobile, and...