Posts

Code, Algorithm, Flowchart, Output for finding vowels in string

Image
 In this blog we will see the Code, Algorithm, Flowchart, Output for finding vowels and total number of characters in string. Algorithm : 1] Start 2] Set the count to 0 3] Loop through the string until it reaches a null character 4] Compare each character to the vowels a, e, i, o, u or A,  E, I, O, U. 5] If both are equal, increase the count by one. 6] Print the count of each vowel at the end. 7] Stop Flowchart:  Output : Enter a string: ABCDEFGHIJKLMNOPQRSTUVWXYZ Total number of characters: 26 A: 1 E: 1 I: 1 O: 1 U: 1 Code :  #include <stdio.h> int main () {     char str [ 100 ];     int i = 0 , count = 0 ;     int A = 0 , E = 0 , I = 0 , O = 0 , U = 0 ;     printf ( "Enter a string: " );     fgets ( str , 10 , stdin );      for ( int i = 0 ; str [ i ] != ' \0 ' ; i ++ ) {         count ++ ;    ...

Code Algorithm, Flowchart, Output for finding maximum and minimum of given number using array

Image
 In this blog we will see the Code Algorithm, Flowchart, Output for finding maximum and minimum of given number using arrays. Algorithm : Start Declare array and terms in array Declare variables i, max, min Enter marks of students Initiate a for loop Store the marks in array Initiate for loop Use if-else to find maximum and minimum value Display the values  End FlowChart : Code : #include <stdio.h> int main () {     int marks [ 5 ], i = 0 , max = 0 , min = 100 ;     printf ( "Enter marks of 5 students: " );     for ( i = 0 ; i < 5 ; i ++ )    {     scanf ( " %d " , & marks [ i ]);    }     for ( i = 0 ; i < 5 ; i ++ )    {         if ( marks [ i ] > max )        {             max = marks [ i ];   ...