# How to calculate float value of 7n/8 or something similar without using arithmetic and fmod functions?

+1 vote
32 views
How to calculate float value of 7n/8 or something similar without using arithmetic and fmod functions?
posted Feb 25, 2016
Looking for an answer?  Promote on:

Similar Questions

e.g. Suppose I enter a string : Ram and Shyam likes Ramesh then the output should be Ramesh and Shyam likes Ram.
Here first word Ram is swapped with Ramesh .

Calculate 1+2+…+n without multiplication, division, key words for, while, if, else, switch, case, as well as conditional operator (A ? B : C).

A number is called as a Jumping Number if all adjacent digits in it differ by 1. The difference between ‘9’ and ‘0’ is not considered as 1.
All single digit numbers are considered as Jumping Numbers. For example 7, 8987 and 4343456 are Jumping numbers but 796 and 89098 are not.

Given a positive number x, print all Jumping Numbers smaller than or equal to x. The numbers can be printed in any order.

Example:

Input: x = 20
Output: 0 1 2 3 4 5 6 7 8 9 10 12

Input: x = 105
Output: 0 1 2 3 4 5 6 7 8 9 10 12
21 23 32 34 43 45 54 56 65
67 76 78 87 89 98 101

Note: Order of output doesn't matter,
i,e., numbers can be printed in any order

I have a recursive function as below,

``````void func()
{
if(counter>10)
return;
func();
}
``````

Here, I need to come out of the function when counter reaches specific number(10 as per example).
Now, the condition is, I can't take this counter as global or static or can't pass this counter as parameter.

Any suggestion to solve this given above terms.