here my script, please help me to resolve it :D thanks

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<float.h>

int main()
{
    /* KAMUS */
        /* volume gas ideal = V=nRT/P
            -R= 8.314

        P: tekanan (Pa/ N/m^2) = 8.5
        V: volume ruang (m^3)
        n: jumlah mol gas (kmol) = 1.5
        R: tetapan umum gas = 8.314 J/kmol
        T: suhu (Kelvin) = 296.75 */

    float mol,tknn;
    float suhu,ttpn;
    float vlm;
    /* Algoritma */

printf("masukkan jumlah mol (kmol):", mol);
    scanf("%f", &mol);
printf("masukkan besar suhu gas (kelvin):", suhu);
    scanf("%f", &suhu);
printf("masukkan tekanan gas (Pa/ N/m^2):", tknn);
    scanf("%f", &tknn);

    ttpn=8.314;


    vlm=mol*ttpn*suhu/tknn;

    printf("Jadi volume gas ideal adalah: \n", &vlm);

return 0;

}

Recommended Answers

All 5 Replies

Your printf format strings don't include any specifiers (like %s, %d, %f etc.). So printf does not expect any arguments after the format string, but you do give arguments. These arguments will be ignored and the compiler warns you about this because that's most probably not what you want.

sepp2k : what must i do ? im newbie about this :D
im sorry

58b39fbbc512a9617ce87caadd54666c

the final result is blank. what shoul i do ?
can you fix them?

You must use format specifiers at the places in the format string where you want your arguments to appear.

yeah finaly i got it.
thanks sepp2k for helping me :D

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.