putar putar

putar putar
mail@pastecode.io avatar
unknown
plain_text
2 years ago
681 B
6
Indexable
Never
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

int main (){
	bool putar, sensorValue, lampu;
	int jumlahPutar = 0;
	printf ("==%d==\n", jumlahPutar);
	lampu = false;
	putar = true;
	sensorValue = true;
	
	while (putar == 1){
		if (lampu == false){
			printf ("\nLampu Mati\n");
		}
		jumlahPutar = jumlahPutar+1;
		printf ("--%d--", jumlahPutar);
		if (jumlahPutar == 100){
			sensorValue = false;
		}
		printf ("kali putar\n");
		if (sensorValue ==  false){
			putar = false;
			lampu = true;
		}
	}
	if (putar == false){
		printf ("\npegat");
	}
	if (lampu == true){
		printf ("\nlampu nyala");
	}
	return 0;
}