# Sample Midterm: Foundations of x

FIND A SOLUTION AT Academic Writers Bay

Lecture Capture
X Sample Midterm: Foundations of x
Gmelbourne time – Google Search x
+
€ → C
canvas.lms.unimelb.edu.au/courses/107518/quizzes/109018
THE UN ME
MELBOURNE
Question 2
Not yet graded / 3 pts
Screenshot has been saved
to Gallery
Col
38
Write a program countvowel that reads a line from keyboard as the input and prints
the number of vowels in that line. A line is a sequence of characters (including digits)
that ends with a newline character (‘n’). The vowels are ‘a’, ‘e’, 1, ‘6’, and ‘u! The
characters can be either lower case or upper case letters. Some examples of the inputs
and outputs are –
mac: ./countvowel
Enter a line: Mary had a little lamb
Number of vowels: 6
mac: ./countvowel
Enter a line: Hello world
Number of vowels: 3
mac: ./countvowel
Enter a line: 1234
Number of vowels: 0
include
include
define NEWLINE ‘n’
int
main(int argc, char argv[]) int nvowels=0; int c; / read characters from the input/ printf(“Enter a line:”); while (c=getchar()) != ‘n’) C == ‘O’ / generate the required report */
printf(“Number of vowels: %dn”, nvowels);
Question 3
Not yet graded / 3 pts

READ ALSO...   In this project, you will need to find, review, and summarize four | History homework help

|
Write a recursive function int fibonacci rec(int n) that returns the nth number in the
Type here to search
9 ) ENG
9:10 PM
31/03/2021
5