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
Sever21 [200]
3 years ago
6

Write a program to check if an input is a valid hashtag (starts with #, contains only letters, numbers, and underscore, no space

or special characters).
(1) Name your program hashtag.c.
(2) The user input ends with the user pressing the enter key (a new line character).
(3) Library function isalpha(), isdigit(), and isalnum() are not allowed in this program.
(4) Use getchar() to read in the input.
Computers and Technology
1 answer:
adell [148]3 years ago
8 0

Answer:

C code is given below

Explanation:

#include<stdio.h>

int main()

{

  printf("Input:");

  int ch;

  int valid=1; // it is set as 1 initially if anything is wrong it is changed to 0

  ch=getchar();

  if(ch!='#') // it checks if it starts with #

  {

      valid=0;

  }

while((ch = getchar())!= '\n') // this loop runs till line ends

  {

if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z')||(ch>='0'&&ch<='9')||(ch=='_')) // if conditions are matched then its okay

{

   

  }

  else // else valid is changed to 0 from 1

  {

     valid=0;

  }

}

if(valid==0) // if anywhere there is anything wrong then it prints not valid

{

  printf("It is not valid hashtag");

  }

  else // else prints valid

  {

      printf("It is a valid hastag");

  }

}

You might be interested in
The two roots of a quadratic equation ax^2 + bx + c = 0 can be obtained using the following formula:
Feliz [49]

Answer: ion k

Explanation:

4 0
3 years ago
When correctly implemented, what is the only cryptosystem known to be unbreakable?
Leona [35]

When accurately executed, the only cryptosystem known to be unbreakable is called: "One-time Pad" (Option D)

<h3>What is a Crypto System?</h3>

The one-time pad is a cryptographic approach that cannot be broken but needs the usage of a single-use pre-shared key that is not less than the message being delivered. A plaintext is coupled with a unique secret key in this manner.

It should be emphasized that in cryptography, a cryptosystem is a collection of cryptographic algorithms that are required to perform a certain security function, such as confidentiality. A cryptosystem is often composed of three algorithms: one just for key generation, one for encrypting, and one for deciphering.

Learn more about Crypto System:
brainly.com/question/15084188
#SPJ1

Full Question:

When correctly implemented, what is the only cryptosystem known to be unbreakable?

A) Transposition cipher

B) Substitution cipher

C) Advanced Encryption Standard

D) One-time Pad

6 0
1 year ago
What are concepts and accrual​
Darya [45]

Answer:

umm oh nvrm i forgot

Explanation:

4 0
3 years ago
Read 2 more answers
Enter the cube's edge: 4<br> The surface area is 96 square units.<br> Python
mr_godi [17]

Answer:

See the program code below.

Explanation:

def cube_SA(edge):

 edge = int(input("Enter the cube's edge: "))

 sa = edge * edge * 6

 print("The surface area is {} square units".format(sa))

cube_SA(4)

Best Regards!

5 0
3 years ago
Which model encourages pair programming to improve productivity?
san4es73 [151]

Answer:

Explanation:

Pair programming is an agile software development technique in which two programmers work together at one workstation. One, the driver, writes code while the other, the observer or navigator, reviews each line of code as it is typed in. The two programmers switch roles frequently.

8 0
2 years ago
Other questions:
  • ____ uses markup to define the structure and layout of a web document.
    11·1 answer
  • Which of these is a biotic factor in an aquatic ecosystem?
    10·1 answer
  • PLEASE HELPPPPPPP
    15·1 answer
  • Fill in the blank with the correct response.
    10·1 answer
  • The process of auditing the source code for an application to verify that the proper security controls are present, that they wo
    14·1 answer
  • What is computer system<br>explain the role of bank in computer<br>​
    15·2 answers
  • Which is the correct option?
    6·1 answer
  • 60 points!
    14·2 answers
  • Write a description about this picture
    13·2 answers
  • Application for a lawn-mowing service. The lawn-mowing season lasts 20 weeks. The weekly fee for mowing a lot under 40 square fe
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!