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
nignag [31]
2 years ago
15

URGENT!

Computers and Technology
1 answer:
lutik1710 [3]2 years ago
6 0

<u>Explanation:</u>

Hey there! you need not to panic about it ,your program didn't have Driver program i.e main program! the correct & working code is given below:

// C++ program to count  even digits  in a given number .

#include <iostream>  

using namespace std;  

// Function to count digits

int countEven(int n)  

{  

int even_count = 0;    

while (n > 0)  

{  

 int rem = n % 10;  

 if (rem % 2 == 0)  

  even_count++;  

 n = n / 10;  

}  

cout << "Even count : "

 << even_count;  

if (even_count % 2 == 0 )  

 return 1;  

else

 return 0;  

}  

// Driver Code  

int main()  

{  

int n;  

std::cin >>n;

int t = countEven(n);  

return 0;  

}  

You might be interested in
What is output? public class MathRecursive { public static void myMathFunction(int a, int r, int counter) { int val; val = a*r;
ycow [4]

Answer:

The output of the program is:

2 4 8 16 32 64 End

Explanation:

See attachment for proper presentation of the program

The program uses recursion to determine its operations and outputs.

The function is defined as: myMathFunction(int a, int r, int counter)

It initially gets the following as its input from the main method

a= 1; r = 2; counter = 0

Its operation goes thus:

val = a*r; 1 * 2 = 2

Print val; Prints 2

if (counter > 4) { System.out.print("End"); } : Not true

else { myMathFunction(val, r, counter + 1); }: True

The value of counter is incremented by 1 and the function gets the following values:

a= 2; r = 2; counter = 1

val = a*r; 2 * 2 = 4

Print val; Prints 4

else { myMathFunction(val, r, counter + 1); }: True

The value of counter is incremented by 1 and the function gets the following values:

a= 4; r = 2; counter = 2

val = a*r; 4 * 2 = 8

Print val; Prints 8

else { myMathFunction(val, r, counter + 1); }: True

The value of counter is incremented by 1 and the function gets the following values:

a= 8; r = 2; counter = 3

val = a*r; 8 * 2 = 16

Print val; Prints 16

else { myMathFunction(val, r, counter + 1); }: True

The value of counter is incremented by 1 and the function gets the following values:

a= 16; r = 2; counter = 4

val = a*r; 16 * 2 = 32

Print val; Prints 32

else { myMathFunction(val, r, counter + 1); }: True

The value of counter is incremented by 1 and the function gets the following values:

a= 32; r = 2; counter = 5

val = a*r; 32 * 2 = 64

Print val; Prints 64

if (counter > 4) { System.out.print("End"); } : True

<em>This prints "End"</em>

So; the output of the program is:

2 4 8 16 32 64 End

3 0
2 years ago
Type the correct answer in the box. Spell all words correctly.
trasher [3.6K]

syntax are programming languages that specify a series of structured functions. C is an example of such a language.

7 0
3 years ago
_____ is responsible for packet forwarding. a. Transmission Control Protocol b. User Datagram Protocol c. Extensible Authenticat
Mazyrski [523]

Answer:

d. Internet Protocol

Explanation:

Internet Protocols suite  are used to transport packets from the host network across other networks. This task is usually performed by optimizing the size of each available packet, which are then forwarded through the internet protocol (IP) address.

Therefore, Internet Protocol is responsible for packet forwarding.

6 0
3 years ago
Consider the efficiency of locating the kth element in a singly-linked list. How does that compare to locating the kth element i
eimsori [14]

Answer:

Finding kth element is more efficient in a doubly-linked list when compared to a singly-linked list

Explanation:

Assuming that  both lists have firs_t and last_ pointers.

For a singly-linked list ; when locating a kth element, you have iterate through a number of k-1 elements which means that locating an element will be done only in one ( 1 ) direction

For a Doubly-linked list : To locate the Kth element can be done from two ( directions ) i.e. if the Kth element can found either by traversing the number of elements before it or after it . This makes finding the Kth element faster because the shortest route can be taken.

<em>Finding kth element is more efficient in a doubly-linked list when compared to a singly-linked list </em>

4 0
2 years ago
What is a hacker who breaks into other people's computer systems and may just look around or steal and destroy?
inessss [21]
A cyber gang or cyber theif
5 0
3 years ago
Read 2 more answers
Other questions:
  • 2. What is “suspension of disbelief?” Which form of immersion is it most closely associated with?
    9·2 answers
  • A blank is a link on a web page that leads to another web page.
    14·1 answer
  • Using C#, declare two variables of type string and assign them a value "The "use" of quotations causes difficulties." (without t
    11·1 answer
  • Which of these jobs would be most appropriate for someone who majors in computer engineering? ANSWER FAST PLEASE
    15·2 answers
  • Help me find the right answer please.
    10·1 answer
  • Which element is located on the top left of the Word screen?
    6·1 answer
  • Convert each of the fo" wing base ten representations to its equivalent binary form a. 6 b. 13 C. d. 18 e. 27
    6·1 answer
  • Why can't I access my micro SD card on my Lenovo ThinkPad Yoga 11e? I'm trying to export some PNG files onto my Micro SD card, s
    6·1 answer
  • What are the paparazzi?
    8·1 answer
  • Write its features:features of computer ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!