Search:

Type: Posts; User: avidrutham

Search: Search took 0.00 seconds.

  1. Program to check whether given number is prime or not?

    :tongue: Hi there, I've written a c program in answer to the following question:

    write a function prime that returns 1 if its argument is a prime number and 0 if it is otherwise.
    My code is:

    ...
  2. How to define epsilon in newton raphson square root program?

    Hi there, I'm working on a c program that generates approximations of square roots based on newton raphson method. I worked out the approximations with another method I learnt and I know this...
  3. Hi, laserlight, I know this is coming late but I...

    Hi, laserlight, I know this is coming late but I finally figured how the second loop is working..Thanks for all your ideas. Also the code I pasted was incomplete. It does have ++i in the end.
  4. Actually, what confuses me is that the print...

    Actually, what confuses me is that the print command is given before the test for multiples is done. So when we reach say p[4], which is set to 1 in the earlier loop, the test done on that is after...
  5. Thank you for the response and please bear with...

    Thank you for the response and please bear with me a little more. I observe that the code initializes all elements in p to 1 in the beginning. At this rate all no.s could have been printed as primes,...
  6. How booleans work in sieve of eratosthenes??

    :confused: I understand the sieve of eratosthenes on paper but in c code I find it hard to get the logic of using booleans like 1 and 0 to filter primes. In the code below, the algorithm for which is...
  7. Thanks a ton...that sorted everything...This...

    Thanks a ton...that sorted everything...This technique will help me even further
  8. Understanding the output of a C program --- Need help

    :D Hi I'm a newbie at programming working with stephen kochan's programming in C. I have an encountered a code in the book where I am unable to understand the output and utterly frustrated after...
Results 1 to 8 of 8