0

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;

}
2
Contributors
5
Replies
22
Views
2 Years
Discussion Span
Last Post by schzatprodn
1

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.

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.