Welcome to thekideo.blogspot.com


Jumat, 03 Februari 2012

Source Code C++ : Menentukan Nilai Negatif, Nol, dan Positif

#include<iostream.h>
using namespace std;


int main ()
{
    double nilai;
    char lg;
    do{
    cout << " Masukan Nilai : ";
    cin >> nilai;
    
    if ( nilai < 0)
    cout << " negatif \n ";
    else
    if ( nilai == 0)
    cout << " nol \n ";
    else
    cout << " positif \n ";
    cout << "Ingin Mengulang Program (Y/T) : ";
    cin >> lg;
    }while (lg == 'Y' || lg == 'y');
    
    system("pause");
    return 0;
}

Tidak ada komentar:

Posting Komentar