C Program for Zip, Zap and Zoom game

C Program for Zip, Zap and Zoom game

Program for zip, zap and zoom game in c; Through this tutorial, we will learn how to write a program for zip, zap and zoom game in c.

Write a c program that displays a message as follows for a given number:

  • If it is a multiple of three, display “Zip”.
  • If it is a multiple of five, display “Zap”.
  • If it is a multiple of both three and five, display “Zoom”.
  • If it does not satisfy any of the above given conditions, display “Invalid”.

C Program for Zip, Zap and Zoom game

// Program to relate two integers using =, > or < symbol

#include <stdio.h>
int main() {
    int number;
    printf("Enter two integers: ");
    scanf("%d", &number);

    //checks if the two integers are equal.
    if(number%3 == 0 && number%5 == 0) {
        printf("zoom");
    }

    //checks if number1 is greater than number2.
    else if (number%5 == 0) {
        printf("zap");
    }

    //checks if both test expressions are false
    else if (number%3 == 0) {
        printf("zip");
    }  
    //checks if both test expressions are false
    else {
        printf("This number is not dividev by 3 and 5");
    }

    return 0;
}

The output of the above c program; is as follows:

Enter two integers: 15
zoom

Recommended C Programs

AuthorAdmin

My name is Devendra Dode. I am a full-stack developer, entrepreneur, and owner of Tutsmake.com. I like writing tutorials and tips that can help other developers. I share tutorials of PHP, Python, Javascript, JQuery, Laravel, Livewire, Codeigniter, Node JS, Express JS, Vue JS, Angular JS, React Js, MySQL, MongoDB, REST APIs, Windows, Xampp, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL and Bootstrap from a starting stage. As well as demo example.

Leave a Reply

Your email address will not be published. Required fields are marked *