Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Incometax problem v0.1
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//gcc 5.4.0 #include <stdio.h> //We would like to write a C program to calculate the income tax of the employees in an organization according the following criteria: //- The income tax is zero = 0 if income less than or equal 10,000 //- The income tax is 10% if the income is less than 50,000. Otherwise, the income tax is 20% if the income is greater than 50000 and less than 99,9999 //- For an income greater than or equal 100000, the tax is 30%. START PROGRAM double income double incometax PRINT "Please Input:\n Name: \n Income:\n" READ income if (income<=10000){ incometax=0; PRINT "Your income tax is %lf",incometax); } else if (income>=10000&&income<=50000){ incometax=income*.1; PRINT "Your income tax is $%lf",incometax); } else if (income>=50000&&income<=999999){ incometax=income*.2; PRINT "Your income tax is $%lf",incometax); } else{ incometax=income*.3; PRINT "Your income tax is $%lf",incometax); } int main(void) { printf("Hello, world!\n"); return 0; }
gcc
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
edit mode
|
history
|
discussion