Ask Question
21 December, 23:31

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. 22 December, 01:15
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers