Hi Dps I am automating an statistic forumala, i am an BSCS student i want a help that suppose i have integers from 1 to 10 or 2 to 5 b/w 2 to 5 there are there are 5 digits ie 2,3,4,5 how i can count them in C only with C,,, Which function i have to use and what function i have to use to add whole column in C Thanks In Advance
Here's the logic. Do the increment from the small number to the big number for (i=small number,small_number -> big number){ i++; if (i<big number) count++; }
Since you are going to use C for this, you can easily get this done without considering the numbers as below. abs is used to get the absolute value of the difference. #include <math.h> abs(number_1 - number_2) + 1