Write an algorithm to print first 5 alphabets of English
Answers
Answer: An algorithm is a set of well-defined instructions to solve a particular problem. It takes a set of inputs and produces the desired output.
Explanation:
#include <stdio.h>
int main()
{
char ch;
printf("Alphabets from a - z are: \n");
for(ch='a'; ch<='e'; ch++)
{
printf("%c\n", ch);
}
return 0;
}
Steps of writing good algorithm
Input and output should be precisely defined.
Algorithms should be the most efficient among many different ways to solve a problem.
The algorithm should not contain computer code. Instead, the algorithm should be written in such a way that it can be used in different programming languages.
This can be understood using the example of cooking a new recipe. To cook a new recipe, you read the instructions and steps and follow them one by one in the given order. The result is that the new dish is perfectly cooked. Every time you use your phone, computer, laptop, or calculator, you are using algorithms. Similarly, algorithms help in programming to get the expected output.
The proposed algorithm is language-independent, that is, it is only simple instructions that can be implemented in any language, and still the output will be the same as expected.
brainly.in/question/12014734
#SPJ1