Skip to main content

Posts

Showing posts with the label Solutions

The Blunder Hackerrank Solution - SQL

 The Blunder Hackerrank Solution - SQL For explanation watch video :: Code: select ceil(avg(salary)-avg(replace(salary,'0',''))) from Employees;

Sum of Digits of a Five Digit Number Hackerrank Solution - C

 Sum of Digits of a Five Digit Number Hackerrank Solution - C Code : #include   < stdio.h > #include   < string.h > #include   < math.h > #include   < stdlib.h > int  main() {           int  n;     scanf( "%d" , &n);      //Complete the code to calculate the sum of the five digits on n.      int  sum =  0 ;      while (n!= 0 ){          int  r = n% 10 ;         n = n/ 10 ;         sum = sum + r;     }     printf( "%d" ,sum);      return   0 ; }