Table of Contents

The Greatest

Adapted by Neilor Tonin, URI  Brazil | Timelimit: 1

Make a program that reads 3 integer values and present the greatest one followed by the message “eh o maior”. Use the following formula:

Input

The input file contains 3 integer values.

Output

Print the greatest of these three values followed by a space and the message “eh o maior”.

Input SamplesOutput Samples
7 14 106106 eh o maior
217 14 6217 eh o maior

Solution

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b,c,d;
    scanf("%d%d%d",&a,&b,&c);
    d=(a+b+abs(a-b))/2;
    d=(d+c+abs(d-c))/2;

    printf("%d eh o maior\n",d);
    return 0;
}
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest
Share on whatsapp
WhatsApp
Share on email
Email
Md. Nurnobi Hosen
Md. Nurnobi Hosen

Student of Computer Science and Engineering at Daffodil International University,Main Campus ,Dhanmondi.
Web and App Developer also expart of wordpress customization

All Blog Posts »
Subscribe
Notify of
guest
2 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
oprol evorter
oprol evorter
December 5, 2019 4:24 PM

F*ckin’ remarkable things here. I am very glad to see your article. Thanks a lot and i’m looking forward to contact you. Will you kindly drop me a e-mail?

oprol evorter
oprol evorter
December 11, 2019 5:35 AM

Woah! I’m really digging the template/theme of this website. It’s simple, yet effective. A lot of times it’s hard to get that “perfect balance” between user friendliness and visual appeal. I must say that you’ve done a superb job with this. Also, the blog loads very quick for me on Chrome. Exceptional Blog!

2
0
Would love your thoughts, please comment.x
()
x