How to calculate: T and his sister J have a combined age of 48, J is twice as old as his sister, how old is J in C

1 Answer

0 votes
#include <stdio.h>

int main() {
    int age;
    
    // age + 2age = 48
    // 3age = 48
    // age = 48 / 3

    age = 48 / 3;

    printf("J age = %d\n", age);
    printf("T age = %d\n", age * 2);
}

 
 
/*
run:
 
J age = 16
T age = 32
 
*/

 



answered Aug 5, 2024 by avibootz
...