Answer:
Step 1 : Start
Step2 : Input first number, num1
Step3 : Input second number, num2
Step4 : product - - > num1 * num2 (product of num1 and num2)
Step5 : Input product, myanswer
Step6 : comparison - - - > correct or incorrect based on myanswer and product
Step6: print(comparison)
Step7: End
Explanation:
Algorithm is a sequence of instructions a computer is expected to follow to solve a particular problem.
Required :
Two inputs ; num1 and num2
Expected output
Algorithm :
Step 1 : Start
Step2 : Input first number, num1
Step3 : Input second number, num2
Step4 : product - - > num1 * num2 (product of num1 and num2)
Step5 : Input product, myanswer
Step6 : comparison - - - > correct or incorrect based on myanswer and product
Step6: print(comparison)
Step7: End
The two numbers to multiply are entered ; the product is calculated by the program ; the the user inputs his or her own expecteted product ;
Both are compared and the output of the comparison is displayed (either correct oe incorrect)
Answer:
The answer to this question is given below in the explanation section.
Explanation:
The question is about writing a C program that prints the initial letter of Name Ferdous.
Therefore, below is the given complete code that prints the first letter of the name Ferdous.
<em>#include <stdio.h> </em><em>/*import strandard input/output library*/</em>
<em>#include<string.h></em><em> /*import string library to handle string type of data*/</em>
<em> </em>
<em>int main(void) </em><em> /*started the program execution- program entry point*/</em>
<em>{ </em>
<em>char *str = "Firdous";</em><em> /*char to pointer str contains string "Firdous"*/</em>
<em>int len = strlen(str); </em><em> /*this line of code is not neccary, but if you print other character for example last character of the name then you can use it*/</em>
<em>printf("First Letter of the name is: %c", str[0]); </em><em> /*print first letter of the name*/</em>
<em>} </em><em> /**program terminated*/</em>