Search:

Type: Posts; User: Prestige

Search: Search took 0.00 seconds.

  1. You are calculating area first (the variable...

    You are calculating area first (the variable area_int has some arbitrary value stored upon declaration and it is this arbitrary value that is used in your calculation) and then you are asking the...
  2. Replies
    5
    Views
    5,031

    So the second code works (due to compiler ?) but...

    So the second code works (due to compiler ?) but it may not work for all compilers. Am I correct ?
  3. Replies
    5
    Views
    5,031

    thanks a lot (and for that quick reply)

    thanks a lot (and for that quick reply)
  4. Replies
    5
    Views
    5,031

    scanning and printing a string

    I use DevC++ as my compiler.

    I used the following two codes:


    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    int main()
    {
  5. Replies
    3
    Views
    2,082

    So, modifying this part will work ? ...

    So, modifying this part will work ?



    while(fscanf(fp1, "%d", &n) > 0)
    printf("%d\n", n);

    How does feof work exactly ?
  6. Replies
    3
    Views
    1,289

    use a getch(); before the return 0. getch waits...

    use a getch(); before the return 0. getch waits for a character from the user before going to the next line. Without getch(). the program reaches return 0 and hence terminates . (It actually prints...
  7. Replies
    3
    Views
    2,082

    Printing a file

    I had written the following code which does the following:
    It takes in a series of integers as input.
    It prints all the integers that come before 42 has been input (assumes that the user inputs 42...
  8. Replies
    3
    Views
    2,323

    oh yeah ... thanks for pointing it out

    oh yeah ... thanks for pointing it out
  9. Replies
    3
    Views
    2,323

    Prime numbers program

    The problem statement is the following
    Problem Statement


    My code is here:

    #include <stdio.h>
    int main()
    {
    int a[10], i, j;
  10. Thread: 3n+1 problem

    by Prestige
    Replies
    4
    Views
    12,243

    I realised that but the problem statement does...

    I realised that but the problem statement does not state how many series of pairs of integers are to be input nor does it give a condition as to when will the input stop (ie after such or such key is...
  11. Thread: 3n+1 problem

    by Prestige
    Replies
    4
    Views
    12,243

    3n+1 problem

    I am posting my solution for the 3n+1 problem on the online judge webpage. The judge seems to give the verdict of "wrong answer" even though the program works for the test cases given in the problem...
Results 1 to 11 of 11