Posts

Showing posts from May, 2022

Who is taller! | Problem - 7 | Beginner level | C language | CodeChef

Link to the problem statement: https://www.codechef.com/submit-v2/TALLER Solution:   #include <stdio.h> int main(void) { int t, x, y, i; scanf("%d",&t); for(i=0;i<t;i++) {     scanf("%d %d", &x, &y);     if(x>y)     {         printf("A\n");     }     else     {         printf("B\n");     } } return 0; } You can watch the video solution of this problem: Hope this will help you, if you want anything else leave a comment. Thank you

How many unattempted problems | Problem - 6 | Beginner level | C language | CodeChef

Link to the problem statement:   https://www.codechef.com/submit-v2/PRACLIST Solution:  #include <stdio.h> int main(void) {     int x, y, z;     scanf("%d %d", &x , &y);     z = x - y;     printf("%d", z); return 0; } You can watch the video solution of this problem: Hope this will help you, if you want anything else leave a comment. Thank you

Add Two Numbers | Problem - 5 | Beginner level | C language | CodeChef

Link to the problem statement: https://www.codechef.com/submit-v2/FLOW001 Solution:  You just need to scroll down, then find the 'submit code' button and click on it. You can watch the video solution of this problem: Hope this will help you, if you want anything else leave a comment. Thank you

Score High | Problem - 4 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/HIGHSCORE Solution:  1st Method: #include <stdio.h> int main(void) { int t, i, n, a, b, c, d, s; scanf("%d", &t); for(i=0;i<t;i++) {     if(t>=1 && t<=1000)     {         scanf("%d",&n);         scanf("%d %d %d %d", &a, &b, &c, &d);         s = a+b+c+d;         if( s == n && n>=a && n>=b && n>=c && n>=d )         {             if(a>=b && a>=c && a>=d)             {                 printf("%d\n", a);             }             else if(b>=a && b>=c && b>=d)             {                 printf("%d\n", b);             }             else if(c>=a && c>=b && c>=d)             {                 printf("%d\n", c);             }             else             {

Total Prize Money | Problem - 3 | Beginner level | C language | CodeChef

Link to the problem statement:   https://www.codechef.com/submit-v2/PRIZEPOOL Solution:  #include <stdio.h> int main(void) { int i, a, x, y, t; scanf("%d", &t); if(t>=1 && t<=1000) {     for(i=0;i<t;i++)     {         scanf("%d %d", &x, &y);         if( y>=1 && x>=y && x<=1000 )         {             a = ( 10 * x ) + ( 90 * y );             printf("%d\n", a);         }     } } return 0; } You can watch the video solution of this problem: Hope this will help you, if you want anything else leave a comment. Thank you

Practice makes us perfect | Problem - 2 | Beginner level | C language | CodeChef

  Link to the problem statement: https://www.codechef.com/submit-v2/PRACTICEPERF Solution:  Method 1 #include <stdio.h> int main(void) {     int a[4], i, j; scanf("%d %d %d %d", &a[0], &a[1], &a[2], &a[3]); for(i=0; i<4 ; i++) {     if(a[i]>=1 && a[i]<=100)     {         if(a[i]>9)         {             j++;         }         else             continue;     }     else         continue; } printf("%d", j); return 0; }  Method 2 #include <stdio.h> int main(void) {     int a[4], i, j;     for(i=0; i<4 ; i++)     { scanf("%d", &a[i]);     } for(i=0; i<4 ; i++) {     if(a[i]>=1 && a[i]<=100)     {         if(a[i]>9)         {             j++;         }         else             continue;     }     else         continue; } printf("%d", j); return 0; } You can watch the video solution of this problem: Hope this wil

My very 1st contest! | Problem - 1 | Beginner level | C language | CodeChef

Link to the problem statement:   https://www.codechef.com/submit-v2/MY1STCONTEST Solution:  #include <stdio.h> int main(void) { int n, a, b; scanf("%d %d %d", &n, &a, &b); int c, d; c = n - a; //user made submissions and will get a rating. d = c - b; //user that were able to solve at least 1 problem and hence will get a            //rating greater than 1000. printf("%d %d", c, d); return 0; } You can watch the video solution of this problem: Hope this will help you, if you want anything else leave a comment. Thank you