Skip to content

Commit

Permalink
Create count.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
saksham101 authored Feb 20, 2021
1 parent 7acc76b commit 70748e8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions count.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
int solve(int A, int B, int C, int D) {

int temp = C, count = 0;
if(C%D != 0){
temp+=D;
temp -=((C)%D);
}
while(temp <= B-A){
temp += D;
count += 1;
}
cout<< count;
}

0 comments on commit 70748e8

Please sign in to comment.