Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <math.h>
- void num();
- void plusOrMinus(int number, int length);
- int main()
- {
- num();
- return 0;
- }
- /*
- This function gets a number,
- counts the amount of digits it
- has and sends it to plusOrMinus.
- */
- void num()
- {
- int length = 0; //setting variables
- int number = 0;
- int numberBackup = 0;
- printf("Please enter a whole number: "); //getting a number
- scanf("%d", &number);
- getchar();
- numberBackup = number;
- while(anumberBackup != 0)
- {
- numberBackup = numberBackup/10;
- length++;
- }
- plusOrMinus(number, length);
- }
- /*
- This function checks if the
- number is positive negative or zero
- */
- plusOrMinus(int number, int length);
- {
- char num[]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement