@Stahta,
I haven't started from scratch:
1. This is another problem, the previous one in the thread "Erroneous answer in algorithm problem" is solved, thanks to you.
2. I earlier incorporated...
Type: Posts; User: abhishekcoder
@Stahta,
I haven't started from scratch:
1. This is another problem, the previous one in the thread "Erroneous answer in algorithm problem" is solved, thanks to you.
2. I earlier incorporated...
Hi All,
I am writing a program to find the number between 1 and 100 that has the greatest number of distinct divisors. Below is my code for the same. It is returning an erroneous answer, i.e. 8...
Hi Stahta,
My program gives the following results to me:
the smallest positive integer with 1 distinct divisors is 1
the smallest positive integer with 2 distinct divisors is 2
the smallest...
Hi Stahta,
Resetting count solves my problem. Thank you.
Hi All,
I am writing a program to find the smallest positive integer that has n or more divisors. My program gives me correct answer for input values upto 4 but it produces erroneous answers for...
Thanks.
Thank you for your reply. Problem solved.
Dear All,
I have written a program to find the smallest divisor of an input number. The code gives me an error in lines 19 and 23. The error is invalid operands to binary %. Please help me...
Thank you for your prompt reply. Solves my problem, apologize for the trivial question, my IDE dev c was running fine with %f so that is why I couldn't detect the problem earlier.
Hi all,
I have written a program to find the reciprocal of an input number by using newton rhapson iterative method. Below is the algorithm implementation in C:
#include<stdio.h>...
Thanks :)
:). I would like to read book that enables me to think algorithms...any suggestions?
Hi Zuk,
Thank you for your reply. The problem is solved with your edits...except for one minor edit, instead of m*m<input, there should be m*m>input, then the algorithm gives proper results.
...
Below is my code...I am encountering an unexpected error. My code doesn't give any output after I enter 9 as input.
/*program finds an integer whose square is closest to but greater than the...
Thanks for your reply. The input is 9, the expected output is 4 and the incorrect output is 3.
Dear All,
I have written a program that finds the integer whose square is closest to but greater than the integer number input as data. But it is giving me an erroneous answer. My algorithm is:
...
Thanks...solved my problem.
Incorporated the changes that you mentioned....program still returning the wrong values...got 2.5 as the square root of 5...
Dear All,
I have written a program to calculate the square root of an input number. It gives me an erroneous answer,for example, when I input the number 5, I get an answer 2.5 whereas I should get...
Thank you for your detailed reply.
I am sorry for that obvious error, I meant if a user enters an ASCII decimal input he gets an ASCII character output.
12 1 2 3 4 5 6 7 8 9 8 7 6
The question is:
Write a program to convert a decimal representation for a number to the corresponding character string representation.
I am using scanf %d representation to input decimal...
@Salem: Now my code works, but is producing the wrong output.
For example if I enter the input sequence length as 4 and input 1,9,.,8 one by one, my code gives me output as 1999 whereas It should...
Thank you for your reply. The program still stops at the same point on changing nchar to ndec.
Hi All,
I have written a program to input a decimal string and convert it to character string. Below is my program:
/*this program converts the decimal representation of an input string to...
I want to convert my input decimal to BCD, 0001 0010 is bcd of 12.