Created
August 2, 2012 08:59
-
-
Save rbe/3235603 to your computer and use it in GitHub Desktop.
2^x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <math.h> | |
| #include <assert.h> | |
| void main() | |
| { | |
| int i, x; | |
| printf ( "\n2^x für OS/2." ); | |
| printf ( "\nCopyright (C) 1995 von Ralf Bensmann" ); | |
| printf ( "\nErstellt in GNU C/C++ für OS/2."); | |
| printf ( "\n\nGeben Sie x ein: " ); | |
| assert ( scanf ( "%d", &x ) ); | |
| printf ( "\n2 hoch x. x e [0; %d]\n\n", x ); | |
| for ( i = 0; i < x+1; i++ ) | |
| printf ( "2^%d = %.0f\n", i, pow ( 2, i ) ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment