Week-1 (B) C Programming
Week-1 (B) C Programming
SPECIFICATION: (1)(b). C program to find the largest of three numbers using ternary
operator.
ALGORITHM:
STEP 1: START
STEP 2: Declare integer variables a,b,c
STEP 3: Read values a, b , c
STEP 4: check if a>b and a>c , then DISPLAY a and goto STEP 7
STEP 5: check if b>c , then DISPLAY b and goto STEP 7
STEP 6: else DISPLAY c
STEP 7: STOP.
FLOWCHART
START
Read a,b,c
TRUE
FALSE
(a>b)&&
(a>c)
FALSE
TRUE
(b>c)
Display a is
greater
Display b is
greater
STOP
Department of Computer Science & Engg
Display c is
greater
PROGRAM
/* C Program to find the largest of three numbers */
/* Done by:-C-Faculty
// wk1b.c
Dated on:- 15/10/2013
*/
#include <stdio.h>
#include <curses.h>
int main()
clear();
./a.out
--xXx--