The document contains code snippets and flowcharts for C programming problems including calculating the area of a triangle, finding the average of three numbers, checking if a number is less than 10, converting Celsius to Fahrenheit, solving a quadratic equation, checking if a year is a leap year, swapping values of two variables, adding and multiplying matrices, adding numbers, finding the largest of three numbers using arrays, printing numbers using do-while and while loops, finding the largest and smallest of three numbers, adding two numbers with call by value, evaluating factorial without and with recursion.
C PROGRAMMING
Display: How
obedientyou are
Code:
Output:
Flowchart
Writeaprogramtotakeanumberlessthan10.
Start
Take input
n
n<10
?
Display:
How stupid!!!
End
Yes No
C PROGRAMMING
Display: Rootsare
Complex!!!
Display: Roots
are= Root1, Root2
Display: Roots
are Equal= Root1
Flowchart
Start
Calculation
d = (b*b) – (4*a*c)
Take values for
a, b, c
d < 0
?
Yes No
d = 0
?
Yes No
Calculation
t=sqrt(d)
Root1= (-b+t)/2*a
Root2= (-b-t)/2*a
Calculation
Root1= -b/2*a
End
C PROGRAMMING
Flowchart
Start
Take input
a
a%
100==
0?
Yes No
a %
400==
0?
Yes No a %
4==0?
Yes No
Display: The
yearis LeapYear
Display:The year
isnot Leap Year
Display: The
yearis LeapYear
Display:The year
isnot Leap Year
End