Trade Fair

Trade Fair 

Problem:

Trade Fairs are important for companies to present their products and to get in touch with their customers and business parties. One such grandeur Trade Fair Event was organized by the Confederation of the National Large Scale Industry.
The number of people who attended the event on the first day was x. But as days progressed, the event gained a good response and the number of people who attended the event on the second day was twice the number of people who attended on the first day. Unfortunately due to heavy rains on the third day, the number of people who attended the event was exactly half the number of people who attended the first day.

Given the total number of people who have attended the event in the first 3 days, find the number of people who have attended the event on day 1, day 2, and day 3.

Input Format:
The first line of the input is an integer value that corresponds to the total number of people.

Output Format:
The first line of the output should display the number of attendees on day 1.
The second line of the output should display the number of attendees on day 2.
The third line of the output should display the number of attendees on day 3.

Sample Input and Output:
Enter the total number of people
10500
Number of attendees on day 1: 3000
Number of attendees on day 2: 6000
Number of attendees on day 3: 1500

Solution Code:

#include<stdio.h>
int main()
{
    int a,b,c,T;
    printf("Enter the total number of people\n");
    scanf("%d",&T);
    a=(T/3.5);
    printf("Number of attendees on day 1 : %d\n",a);
    b=(T/3.5*2);
    printf("Number of attendees on day 2 : %d\n",b);
    c=(T/3.5/2);
    printf("Number of attendees on day 3 : %d",c);
    return 0;
}

Output:

> Enter the total number of people
> 10500
> Number of attendees on day 1: 3000
>Number of attendees on day 2: 6000
>Number of attendees on day 3: 1500
 >

Comments