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

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including 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. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

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