Posts

Showing posts from June, 2020

Home

Image
Chef of Codechef help you to solve programming question of codechef. For HacherRank Problem solving doubt visit below given link :- https://hackofhackerrank.blogspot.com/2020/08/home.html For any doubts in codechef question you may write in this as a comment. Winner Winner Chicken Dinner   

Lost Weekends

Question :- https://www.codechef.com/problems/LOSTWKND Solution in C language :- #include <stdio.h> int main(void) { int t,i; scanf("%d",&t); int sum=0,a[5],p; for(i=0;i<t;i++){     sum=0;     for(int j=0;j<5;j++){         scanf("%d",&a[j]);         sum=sum+a[j];         }     scanf("%d",&p);         if(sum*p<=120)         printf("No\n");     else         printf("Yes\n"); } return 0; }

Days in Month

Question :- https://www.codechef.com/problems/NW1 Solution in C language :- #include <stdio.h> #include<string.h> int main(void) { // your code goes here int q,i; scanf("%d",&q); for(i=0;i<q;i++){     int temp , j , w , c=1 , a[7]={ };     char s[6]="\0";     scanf("%d",&w);     scanf("%s",s);     if(strcmp(s,"mon")==0){         temp=0;         a[0]=1;     }     else if(strcmp(s,"tues")==0){         a[1]=1;         temp=1;     }     else if(strcmp(s,"wed")==0){         a[2]=1;         temp=2;     }     else if(strcmp(s,"thurs")==0){         a[3]=1;         temp=3;     }     else if(strcmp(s,"fri")==0){         a[4]=1;         temp=4;     }     else if(strcmp(s,"sat")==0){         a[5]=1;         temp=5;     }     else if(strcmp(s,"sun")==0){         a[6]=1;         temp=6;