You don’t see anything because the condition results to false. Your variable a is float, while 1.0/k in if clause is double. They have different precision and therefore are not equal. In general it is a bad idea to compare floats on equality.
More Related Contents:
- Pattern Programmings
- Algorithm to find the smallest number in an array in C [closed]
- Recursive C function
- Finding target sum of two numbers in array
- How to remove blank spaces from buffer [closed]
- What is the fastest/most efficient way to find the highest set bit (msb) in an integer in C?
- hash function for string
- Algorithm: efficient way to remove duplicate integers from an array
- how to rasterize rotated rectangle (in 2d by setpixel)
- Building a logarithm function in C without using float type
- How can I simplify this working Binary Search code in C?
- Project Euler Question 14 (Collatz Problem)
- How do you print the EXACT value of a floating point number?
- Time complexity of a recursive algorithm
- How to find largest triangle in convex hull aside from brute force search
- C – How to implement Set data structure?
- Print all the permutations of a string in C
- Correctness of Sakamoto’s algorithm to find the day of week
- Why prefer start + (end – start) / 2 over (start + end) / 2 when calculating the middle of an array?
- Linked list recursive reverse
- Generating a uniform distribution of INTEGERS in C
- Rolling median in C – Turlach implementation
- Rolling median algorithm in C
- Floating point linear interpolation
- Finding the intersecting node from two intersecting linked lists
- Finding out the duplicate element in an array
- Does C have any tools for doing string addition?
- a working non-recursive floodfill algorithm written in C?
- Algorithm to pick values from array that sum closest to a target value?
- Avoid Overflow when Calculating π by Evaluating a Series Using 16-bit Arithmetic?