TRENDING NEWS

POPULAR NEWS

C Program Wont Run Help

HELLPPPP!!!!!!Need help python program won't run my while loop stops at one run of the program?

This program calculates interest payment

def interestpayments(pB,mP,i):
year=1
n=1
month=1
previousBalance=pB
monthly_payment=mP
interest_rate=i
while (pB>mP):
nB=pB+i-mP
month=month+1
n=n+1
print(month,pB,mP,i,nB)
return pB
if (pB print(month,pB,mP,i,nB)


original_balance=int(input("Enter the intial balance in $?"))
interest_rate=float(input("Enter the annual percentage rate?")) #Example, as .15 or .25
interest_rate=((interest_rate/12))
monthly_payment=(int(input("Enter the monthly payment?")))

pB=interestpayments(original_balance,m...

Do C programs run on linux?

First of all, the language you use and the operating system on which you run your code are two separate issues. Of course it is a good question whether or not a compiler for a particular language is available for a particular platform, but C being one of the most universal languages out there, this is certainly not a problem for common platforms. C was pretty much invented to write UNIX, the predecessor of Linux, and most of modern Windows is also written in C/C++, so yes, C compilers are available for both platforms.And if by "low level" programs, you mean (by way of example) a program that runs from the command line and doesn't do anything fancy with the hardware (no flashy graphics, no sound) then yes, it is eminently possible to write code either in pure C or C++ that can be compiled without change and run on both platforms.If you are doing something fancy (graphics, sound, etc.) things get a little complicated. But the reason for that is that such fancy things necessarily go beyond the language, relying instead on various special-purpose libraries supplied either as part of the compiler or the operating system. These libraries tend to be very different on different platforms, though you may be able to find a suitable cross-platform library that satisfies your requirements.Under (almost) no circumstances though will you be able to run the same executable file on both platforms. That is, your C/C++/etc. program, even if it needs no modification, needs to be recompiled for both platforms.Why "almost"? Many Windows programs can be run, on Linux, using the WINE (a self-referential acronym, Wine Is Not an Emulator) compatibility layer. With the help of WINE, you can run Windows executables (including programs with graphics and sound, and programs of your own creation) unmodified on Linux, without the need to recompile. WINE is not compatible with all Windows code, but it is surprisingly good, so simple programs of your own creation almost certainly would run.

How to run Turbo C programs on Dev C++?

I do not know the answer to your question. But I have been a programmer for more than 3 decades in various languages, including Turbo C many (MANY!!) years ago. I suspect that you should look for why it doesn't work in Dev C++. There are a couple of things that come to mind first.

1) Does Dev C++ expect different function declarations? Are the expected syntax of the language identical in each C version?
2) No two compilers developed by different manufacturers function 100% identically. Look for those differences.
3) Do the include files exist in the places that you think they are in Dev C++? Is the default path to the .h files the same for both versions of C? Prove it to yourself.
4) Do you need (or can you) to precompile the .h files in Dev C++ such that it understands the contents of those files?

Beginning C programming help?

Build a number guessing game that uses input validation (isdigit()function) to verify that the user has entered a digit and not a non-digit (letter). Store a random number between 1 and 10 into a variable each time the program is run. Prompt the user to guess a number between 1 and 10 and alert the user if he was correct or not.

I don't know what I'm doing wrong here. Any help?

#include
#include
#include
#include


main()
{
char cResponse = '/0';
int iRandomNum = 0;
srand(time(NULL));

iRandomNum = (rand() % 10) + 1;

printf("\nPlease guess a digit between 1 and 10: ");
scanf("%c", &cResponse);

if ( isdigit ( cResponse == iRandomNum ) )
printf("\nThank you\n");
else
printf("\nWrong the correct answer is %d", iRandomNum);


getch();
return(0);

}

When I compile and run it works but then when I get the answer right, it still says that its wrong even though its correct.

http://i936.photobucket.com/albums/ad203/swisscheevious/Debug.jpg

Any help please? I'm new at this.

I want to run my php programs on internet explorer.how can i?

i cant run my programs of php in following URL:
http://localhost/progrm/php_prog
program is virtual dir.
php_prog is a folder wr php programs saved.Pls help me wts the problem.Till last day i was working with it.Suddenly this problem arise.Let me no as soon s possible.

I am not able to run my C program in Turbo C++. After compiling when I click on run it does not show me the output. What do I do?

Check your program. If you think that turboC is not working properly then check out your directory of TurboC++ otherwise try other IDE such as CodeBlock, DevC++. You can try online IDE. Go to this websiteIdeone.com

Why doesn't my C program run in Command Prompt? I don't have any errors.

Run your program under a source level debugger, and find out for yourself. Since we have absolutely no knowledge of the program, the compiler, or the target architecture, any other replies are just wild guesses. If you’re going to write programs that need to work, you need to get acquainted with your tools. This is a great opportunity.

Why is my codeblocks program not able to build and run?

This happens due to the Compiler.Go to Settings -> Compiler -> Selected Compiler Must be GNU gcc compiler and there will be an option to Reset Defaults. Just reset it and then press ok.Now u are able to run your code in CodeBlocks.If it doesn’t help, feel free to ask back.

Intro to C++ Program I need help on my programming assignment I can't seem to get the right results at the end. The question is:?

An Internet service provider has three different subscription packages for its customers:

Package A: For $15 per month with 50 hours of access provided.
Additional hours are $2.00 per hour over 50 hours.
Assume usage is recorded in one-hour increments,


Package B: For $20 per month with 100 hours of access provided.
Additional hours are $1.50 per hour over 100 hours.


Package C: For $25 per month with 150 hours access is provided.
Additional hours are $1.00 per hour over 150 hours

Write a program that calculates a customer’s monthly charges.
Implement with the following functions for your solution.
getPackage
validPackage
getHours
validHours
calculatePkg_A
calculatePkg_B
calculatePkg_C
calculateCharges
showBill

TRENDING NEWS