Header Ads

Header ADS

Solution of URI 1759::Ho Ho Ho

Before seeing the solution make sure that you have tried enough. Don’t copy the whole code, just find out the logic. If you feel any problemyou will inform me by comment.




#include <stdio.h>
int main(){
    long int n,i;

    scanf("%ld",&n);

    for(i=1;i<=n;i++){
        if(i==n){
            printf("Ho!\n");
        }
        else{
            printf("Ho ");
        }
    }
    return 0;
}

No comments

Theme images by konradlew. Powered by Blogger.