CodeMarshal Solution সর্বোচ্চ সংখ্যা (Maximum Number) - Solution in C Programming
CodeMarshal Online Judge Solution সর্বোচ্চ সংখ্যা (Maximum Number)
CodeMarshal Main Problem Link - https://algo.codemarshal.org/problems/556b5a1e9c5e850300c49cac
Problem Name: CodeMarshal Problem সর্বোচ্চ সংখ্যা (Maximum Number) Solution
Problem Number : CodeMarshal Problem সর্বোচ্চ সংখ্যা (Maximum Number) Solution
Online Judge : CodeMarshal Online Judge Solution
Solution Language : C
CodeMarshal Maximum Number Solution Code in Basic C (By Simple if-else):
#include <stdio.h> int main () { int i, j, n; scanf("%d", &n); for(i = 0; i < n; i++) { int n1, n2, n3, max_number = 0; scanf("%d %d %d", &n1, &n2, &n3); if(n1 >= n2 && n1 >= n3) { max_number = n1; } if(n2 >= n1 && n2 >= n3) { max_number = n2; } if(n3 >= n1 && n3 >= n2) { max_number = n3; } if(n3 == n2 == n1) { max_number = n3; } printf("Case %d: %d\n", i+1, max_number); } return 0; }
No comments:
Post a Comment