Advertisement
frain8

Untitled

Nov 19th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.93 KB | None | 0 0
  1. /* Dasproc C - 2019
  2. William Handi Wijaya
  3. 0087
  4.  
  5. Menentukan jenis gelombang
  6. */
  7.  
  8. #include<stdio.h>
  9.  
  10. int main(){
  11.     //variable declarations
  12.     double input; // input - user's wavelength
  13.     //looping program
  14.         //get the value of wavelength and displays it
  15.     printf("Enter the wavelength -> ");
  16.     scanf("%lf", &input);
  17.     while(input!=0){
  18.         if(input<=3E-11){
  19.             printf("It is gamma ray.\n"); //displaying
  20.         } else if (input<=3E-9){
  21.             printf("It is X-ray.\n"); //displaying
  22.         } else if(input<=4E-7){
  23.             printf("It is Ultraviolet.\n"); //displaying
  24.         } else if(input<=7E-7){
  25.             printf("It is visible.\n"); //displaying
  26.         } else if(input<=1.4E-5){
  27.             printf("It is infrared.\n"); //displaying
  28.         } else if(input<=0.1){
  29.             printf("It is microwave.\n"); //displaying
  30.         } else {
  31.             printf("It is radio wave.\n"); //displaying
  32.         }
  33.         printf("Enter the wavelength -> ");
  34.         scanf("%lf", &input);
  35.     }
  36.     printf("Program ends.");
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement