Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Dasproc C - 2019
- William Handi Wijaya
- 0087
- Menentukan jenis gelombang
- */
- #include<stdio.h>
- int main(){
- //variable declarations
- double input; // input - user's wavelength
- //looping program
- //get the value of wavelength and displays it
- printf("Enter the wavelength -> ");
- scanf("%lf", &input);
- while(input!=0){
- if(input<=3E-11){
- printf("It is gamma ray.\n"); //displaying
- } else if (input<=3E-9){
- printf("It is X-ray.\n"); //displaying
- } else if(input<=4E-7){
- printf("It is Ultraviolet.\n"); //displaying
- } else if(input<=7E-7){
- printf("It is visible.\n"); //displaying
- } else if(input<=1.4E-5){
- printf("It is infrared.\n"); //displaying
- } else if(input<=0.1){
- printf("It is microwave.\n"); //displaying
- } else {
- printf("It is radio wave.\n"); //displaying
- }
- printf("Enter the wavelength -> ");
- scanf("%lf", &input);
- }
- printf("Program ends.");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement