HELPING CHEF solution in C language.- Codechef
HELPING CHEF
Problem Code: FLOW008
Write a program, which takes an integer N and if the number is less than 10 then display "Thanks for helping Chef!" otherwise print "-1".
Input
The first line contains an integer T, total number of testcases. Then follow T lines, each line contains an integer N.
Output
For each test case, output the given string or -1 depending on conditions, in a new line.
Constraints
- 1 ≤ T ≤ 1000
- -20 ≤ N ≤ 20
Example
Input 3 1 12 -5 Output Thanks for helping Chef! -1 Thanks for helping Chef!
. . .
Solution in C.
#include <stdio.h> #include <stdlib.h> int main() { int t; scanf("%d",&t); while(t--){ int a; scanf("%d",&a); if(a<10){ printf("Thanks for helping chef!\n"); } else{ printf("-1\n"); } } return 0; }
Try Solution On The C-Playground : https://bit.ly/3smzq7b
Comments
Post a Comment