Question: Q 7 Write a C program that does the following: Uses nested for loops. Asks for and accepts a number between 1 and 1 0
Q Write a C program that does the following:
Uses nested for loops.
Asks for and accepts a number between and
Produces an output as shown in the sample outputs.
Q Write a C program that does following:
Initializes a character array containing the sentence "Better late than never."
Uses the strtok function to tokenize the string, using a space and period as delimiters.
Prints each token ie each word on a new line.
Prints an output as shown below:
Better
late
than
never
Q Write a C program that does the following:
i Declares a char array sentence of characters and initializes it as an empty string.
ii Uses an infinite loop to read a string of words using gets
iii The program exits the infinite loop if the user enters the word "exit".
iv Prints each word in a separate line using strtok
v Gives an output as follows:
Enter a sentence type 'exit' to quit: Call it a day.
Call
it
a
day.
Enter a sentence type 'exit' to quit: Bite the bullet.
Bite
the
bullet.
Enter a sentence type 'exit' to quit: Break a leg.
Break
a
leg.
Enter a sentence type 'exit' to quit: exit
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
