To find a trendy number in C, you typically define a trendy number as one that is a two-digit number whose digits sum to a specific value, often 10. You can use a loop to iterate through the numbers from 10 to 99, checking if the sum of their digits equals the target value. If it does, you can store or print that number. Here's a simple example:
for (int i = 10; i < 100; i++) {
int sum = (i / 10) + (i % 10);
if (sum == 10) {
printf("%d ", i);
}
}
Chat with our AI personalities
Let the numbers be A,B and C and assume that A ≠ B ≠ C 1) Subtract B from A. If the result is a positive number then A > B otherwise B > A. 2) Subtract the greater of A and B from C. If the result is a positive number then C is the largest number otherwise the subtrahend (either A or B) is the largest number.
int matrix[][]; // the matrix to find the max in int max = matrix[0][0]; int r,c; for(r = 0; r < 3; ++r) { for(c = 0; c < 3; ++c) { if(matrix[r][c] > max) { max = matrix[r][c]; } } } // max is now the maximum number in matrix
(axa)+(bxb) = (cxc) c is the hypotenuse. any number that substitutes for a and b would equal c.
one- sixth of the square of a number is 24 find the number a .10 b .12 c.18 d.24
dim a,b,c a=cint(inputbox("enter value for a")) b=cint(inputbox("enter value for b")) c=cint(inputbox("enter value for c")) if((a>b)and(a>c)) then msgbox "greatest number is a="&a else if ((b>a)and(b>c)) then msgbox "greatest number is b="&b else msgbox "greatest number is c="&c end if end if