Question

0 x البريد - مؤيد الخليفه - اد البريد - مؤيد علي بن عليا 0 | | Kru ترجمة Google x gramming البريد الإلكتروني 0 0X إجراء الاخت Use C language

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The C code for the given program is :

#include <stdio.h>

#include<stdlib.h>

int main(void) {

int n; // the number to be inserted

while(1) // the loop will run until there is an exit condition inside the loop

{

printf("Enter a positive integer as user input \n");

scanf("%d",&n); // enter the number

if(n== -100)

{

exit(0); // exit from the program if user presses -100

}

if( n < 0 ) // check for negative number

{

printf("The number is negative \n");

}

if(n >= 0 && n <= 9) // check for single digit number

{

printf("The number is single digit \n");

}

if(n > 9) // check for numbers greater than 9

{

printf("The number is bigger than 9 \n");

}

}

return 0;

}

The screenshot of the program :

#include <stdio.h> #include<stdlib.h> int main(void) { int n; // the number to be inserted while(1) // the loop will run unti

The screenshot of the output :

./main Enter a positive integer as user input The number is single digit Enter a positive integer as user input The number is

Add a comment
Know the answer?
Add Answer to:
Use C language 0 x البريد - مؤيد الخليفه - اد البريد - مؤيد علي بن...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT