Menu

Hackerearth – Fizz Buzz Test

January 27, 2017 - Hackerearth

Language: C++

#include<iostream>
#include<cstdio>
#define MAX 100005
 
using namespace std;
 
int main()
{
    int i;
    for(i=1;i<=100;i++)
    {
        if(i%3==0 && i%5==0)
        printf("FizzBuzz\n");
        else if(i%3==0)
        printf("Fizz\n");
        else if(i%5==0)
        printf("Buzz\n");
        else
        printf("%d\n",i);
    }
    return 0;
}

(300)

It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on VK

Author of this post : UnknownA AuthorA

Leave a Reply

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