Posts

Showing posts with the label if condition

C program Biggest of 3 number

The following two C program finds biggest of given 3 numbers read from the user using if conditional statement and ternary operator. The input 3 numbers read from user as inputs and finds biggest number from the inputs. IF condition and ternary operator if-else ladder if ( <condition-1> ) { <statements 1 > } else if ( <condtion-2>) { <statements 2 > } else { <statements 3 > } if-else ladder has successive one or more if and if-else conditional statements, if any one of condition satisfied in if-else ladder, control executes following statements enclosed by curly brace { <statement>} and then control come out of if-else ladder. if a condition is not satisfied in if-else ladder, control goes to next condition else-if (<statement>). if none of condition satisfied in if-else ladder, the control executes else part...

A character is vowel or not

It is a program to find a character given by user is vowel or not. The character read from user verified by condition statement. If the condition is satisfied, the character is vowel, otherwise it is not a vowel character. The two C program shown below finds a character is vowel or not by two different technique. They are, IF conditional statement switch case statement A character is vowel or not - C program using If condition The C program finds a given character is vowel or not using a If conditional statement. while the program is running, a character is read from user and verify the given character is satisfied by condition or not. # include <stdio.h> # include < string .h> int main () { char ch; printf("\n Find a given character is vowel or not "); printf("\n Enter a character :"); scanf("%c",&ch) ; if ( ch=='a' || ch=='e' || ch...