1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Musya8 [376]
3 years ago
9

Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outpu

ts yes if every character is a digit 0-9. You may assume that the string does not contain spaces and will always contain less than 50 characters.Ex: If the input is:1995the output is:yesEx: If the input is:42,000 or1995!the output is:noHint: Use a loop and the isdigit() function (don't forget to include the ctype library).
Computers and Technology
1 answer:
ANEK [815]3 years ago
7 0

Answer:

#include <stdio.h>

#include <ctype.h>

int main(void) {

char data[50];

int i;

   printf("Enter data: ");

   scanf("%s", data);

 

for (i = 0; data[i] != '\0'; ++i){

 if(isdigit(data[i]) == 0){

  printf("\nno");

  return 0;

 }

}

printf("\nyes");

return 0;

}

Explanation:

Step 1 : Define variables and libraries

  • Variables:

           char data[50];

     int i;

  • Libraries:

           #include <stdio.h>

           #include <ctype.h>

Step 2:  Read the data and asign to variable:

       printf("Enter data: ");

       scanf("%s", data);

Step 3: Loop over the data :

       for (i = 0; data[i] != '\0'; ++i)

Step 4: Validate if the element is digit:

       if(isdigit(data[i]) == 0)

Step 5: If the element is not digit print no and finish the program:

               if(isdigit(data[i]) == 0){

  printf("\nno");

  return 0;

 }

Step 6: If all elements are digits print yes and finish the program:

       printf("\nyes");

return 0;

You might be interested in
A part-time job performed while in high school must have the approval of your school counselor.
Artist 52 [7]

Answer:

False, it only needs approval of your parents/guardian

May I have brainliest please? :)

4 0
3 years ago
Read 2 more answers
A SOHO's connection to the internet is through an antenna that sends and receives a microwave signal to the ISP's antenna. There
aksik [14]

Answer:

Line of sight wireless

Explanation:

Line of sight wireless are wireless which enable antenna to sends and receives a microwave signal to the ISP's antenna

By standing between the mounted antenna at client building so that the other side of the wireless connection you intend to create can be visible.

Line of Sight wireless also provide electro-magnetic radio waves that tends to be less affected by external forces leading to better connection reliability because all wireless networks excel only with true line of sight that is why it is always advisable that the antennas are mounted above the tree line, to ensure proper connections without obstacles between them since

Line of sight depend on having a clear line of sight between the antenna and the hotspot .

3 0
3 years ago
Which type of network is the internet? choose the answer
Alex Ar [27]

Answer:

WAN or wide area network

Explanation:

The Internet is the most basic example of a WAN. It is connecting all computers together around the world.

5 0
3 years ago
Match the column.<br> Description Shortcut key<br> Move to next cell in row page up
Musya8 [376]

The matchup are:

1) move to next cell in row - tab

2) move to previous cell in row - shift+tab

3) up one screen - page up

4) down one screen - page down

5) move to next worksheet - ctrl + page down

6) move to previous worksheet - ctrl + page up

7) go to first cell in data region - ctrl+ home

8) go to last cell in data region - ctrl + end

<h3>What are computer shortcut keys?</h3>

A computer shortcut is known to be some group of one or a lot of keys that brings about a command in software or in any kind of operating system.

Hence, The matchup are:

1) move to next cell in row - tab

2) move to previous cell in row - shift+tab

3) up one screen - page up

4) down one screen - page down

5) move to next worksheet - ctrl + page down

6) move to previous worksheet - ctrl + page up

7) go to first cell in data region - ctrl+ home

8) go to last cell in data region - ctrl + end

Learn more about computer shortcut from

brainly.com/question/12531147

#SPJ1

4 0
1 year ago
What are the four elements of game design?<br><br> Help Me!!
Rufina [12.5K]

Answer:

aesthetic story mechanic technology

3 0
3 years ago
Other questions:
  • Does a soda vending machine Give reciepts?<br><br>need for computer science hw
    7·2 answers
  • Sending a employee an email with important criticism represents a problem which communication process
    9·1 answer
  • "In an artificial neural network, what input values will cause the neuron below to produce an output of 1". Group of answer choi
    12·1 answer
  • What are computer crimes?​
    14·1 answer
  • 9. Themes can be modified using variants. *<br><br>True<br>False​
    7·2 answers
  • What can be used to help diagnose and fix network connection problems?
    8·1 answer
  • When a company sends you recommendations of what to buy you know that :
    12·1 answer
  • 5 efectos del desarrollo tecnológico en el medio ambiente
    14·1 answer
  • AfcAAgrwdsgsFsefvzsdfvbjhbdjbbjbjsdndVHFadbhZJBVdb
    10·2 answers
  • It would be at least two decades before some of
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!