Ask Question
15 August, 07:40

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

+5
Answers (1)
  1. 15 August, 09:26
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers