4. Do I Have a Real Fear? by CodeChum Admin Shux, I'm starting to get back up but I feel like I'm scared. Life seems too overwhelming. Wait, what are you saying? Are you saying I don't have to worry...





4. Do I Have a Real Fear?


by CodeChum Admin






Shux, I'm starting to get back up but I feel like I'm scared. Life seems too overwhelming.



Wait, what are you saying? Are you saying I don't have to worry about anything because my fear is non-existent in an array of fears?





Instructions:



  1. Create a program that asks the user for the size of the array of fears and then integer inputs which represents a certain fear. Store these integer inputs in the array of fears you created after getting the size.

  2. Then, ask the user for the value of x which represents the fear of the stranger we're helping.

  3. Finally, go through the array of fears and check if the fear of the stranger is not in the array of fears. If it is not in there, print "You have nothing to worry about". Otherwise, just be silent...






Input




1. Size of the array of fears




2. Series of integer values representing the fears




3. Value of x representing the fear of the stranger







Output





Enter the size: 5

Enter fear #1: -3

Enter fear #2: 4

Enter fear #3: 10

Enter fear #4: 1

Enter fear #5: 15

Enter the value of x: 9

You have nothing to worry about



main.c<br>><br>+ c<br>16<br>printf(

Extracted text: main.c > + c 16 printf("Enter the value of x: "); scanf("%d" ,&n); 17 18 19 while (n=f[i]) { fear-f[i]; if(n==f[i]) { printf("You have nothing to worry about"); break; } -f[i]; %3D 20 21 - 22 23 24 25 26 27 28 29 if(n!=f[i]) { printf("%"); } } 30 31 32 33 34 35 return 0; 37 } 36
of the stranger<br>main.c<br>><br>+ c<br>1<br>#include<stdio.h><br>Output<br>3 - int mainO{<br>4<br>int n,i,ctr,fear,x,f[20];<br>ctr = n;<br>Enter the size: 5<br>Enter fear #1: -3<br>printf(

Extracted text: of the stranger main.c > + c 1 #include Output 3 - int mainO{ 4 int n,i,ctr,fear,x,f[20]; ctr = n; Enter the size: 5 Enter fear #1: -3 printf("Enter the size: "); scanf("%d",&n); Enter fear #2: 4 8 Enter fear #3: 10 9. 10 Enter fear #4: 1 11 for(i=1;i<=n;i++) enter fear #5: 15 12 printf("enter fear #%d: ",i); scanf("%i",&f[i]); } enter the value of x: 9 13 you have nothing to worry about 14 15 16 printf("enter the value of x: "); scanf("%d",&n); 17 18 + 567 enter="" fear="" #5:="" 15="" 12="" printf("enter="" fear="" #%d:="" ",i);="" scanf("%i",&f[i]);="" }="" enter="" the="" value="" of="" x:="" 9="" 13="" you="" have="" nothing="" to="" worry="" about="" 14="" 15="" 16="" printf("enter="" the="" value="" of="" x:="" ");="" scanf("%d",&n);="" 17="" 18="" +="">
Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here