Ask Question
18 December, 02:56

Write a program that accepts a number as input, and prints just the decimal portion. Your program must account for negative numbers.

Sample Run

Enter a number: 15.789

Sample Output

0.789

+3
Answers (1)
  1. 18 December, 03:17
    0
    Answer:here I write code

    Explanation:

    #include

    int main (void) {

    char x[]="";

    int a, b, Flag=0;

    gets (x);

    b=sizeof (x);

    for (a=0; a
    if (x[a]=='.')

    Flag=1;

    if (Flag==1)

    printf ("%c", x[a]);

    }

    return 0;

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a program that accepts a number as input, and prints just the decimal portion. Your program must account for negative numbers. Sample ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers