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...
Type: Posts; User: Prestige
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...
So the second code works (due to compiler ?) but it may not work for all compilers. Am I correct ?
thanks a lot (and for that quick reply)
I use DevC++ as my compiler.
I used the following two codes:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
So, modifying this part will work ?
while(fscanf(fp1, "%d", &n) > 0)
printf("%d\n", n);
How does feof work exactly ?
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...
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...
oh yeah ... thanks for pointing it out
The problem statement is the following
Problem Statement
My code is here:
#include <stdio.h>
int main()
{
int a[10], i, j;
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...
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...