Documente Academic
Documente Profesional
Documente Cultură
FLOWCHART: Start
Read integer
b=(float)a
Print value
Stop
FLOWCHART:
Start
READ a, b
c=a*b;
Print c
Stop
RESULT: Thus the c program to produce the Multiplication result of given two Numbers was written, entered, executed and the output was verified.
FLOWCHART:
Start
tot=m1+m2+m3+m4+m5; avg=tot/5;
Display avg
Stop
RESULT: Thus the c program to calculate the Average of given five Numbers was written, entered, executed and the output was verified.
EVALUATION OF AN EQUATION
Start
Read v,c,g,d
Print r
Stop
RESULT: Thus the c program to evaluate the given Equation was written, entered, executed and the output was verified.
Start
Read millimeter
m=mm*1000;
Print mm
Stop
RESULT: Thus the c program to convert given millimeter measurement into meter was written, entered, executed and the output was verified.
SCIENTIFIC PROBLEM SOLVING USING DECISION MAKING AND LOOPING EX: NO: 05 (a) FLOWCHART:
Start
Read n
rem=a%2
Is rem==0
Print even
Print odd
Stop
RESULT: Thus the c program to check whether given Number is odd or even was written, entered,executed and the output was verified.
FINDING BIGGEST OF 3
FLOWCHART:
Start
Read a,b,c
Big=x
yes
Is y >big
Big=y
no
yes
Is z>big
Big=z
Print big
Stop
RESULT: Thus the c program to examine the biggest of given three numbers was written, entered,executed and the output was verified.
FLOWCHART:
Start
READ n
I=1
No
Is i<=n
yes
sum=sum+i; i++;
Print sum,n
stop
RESULT: Thus the c program to find the sum of N natural numbers for given range was written, entered, executed and the output was verified.
Start
READ n
Sum=0
Is n>=0
yes
Print sum
stop
RESULT: Thus the c program to find the sum of digits for a given number was written, entered, executed and the output was verified.
FLOWCHART:
Start
Read x,n
J= 1
for i=1;i<n*2;i+=2
sum=1
For i=1;i<=n;i++
sum=sum*i;
Print res
stop
RESULT: Thus the c program to find the sum of digits for a given number was written, entered, executed and the output was verified.
FLOWCHART:
Start Read a,b
no
Is n<=4
&n>0
Read n B
Switch n
yes
Case 1 C=a+b
no
Case 2 C=a-b Print c
PRINT C
no
Case 3 C=a*b Print c
no
Case 4 C=a/b Print c
no
Case 0 A B Print invalid
Stop
RESULT: Thus the menu driven c program to implement an Arithmetic Calculator was written, entered, executed and the output was verified.
TO CHECK PALINDROME
start
Read num
Is num!=0
Rem=num%10
a= =rnu m
Is
Rnum=rnum*10+rem
num=num/10
Print plindrome
stop
RESULT: Thus the program to check the number is palindrome is verified and executed.
start
Read num
i<=num-1
yes Is num%i==0
yes
stop
RESULT: Thus the program to check the number is prime is verified and executed.
start
Read num
Is num!=0
Is h==s
stop
RESULT: Thus the program for checking the Armstrong number is verified and executed.
start
Read bnum
while(b num!=0
stop
=4
RESULT: Thus the program for convert the binary to decimal is verified and executed.
start
Print num
Is num==0
Print 0
For i=0;i<num;i++
stop
Print fib
RESULT: Thus the program for convert to find the fibbonacci series is verified and executed.
start
Read year
Is year%4
Is leap year
stop
RESULT: Thus the program for convert to find the leap year is verified and executed.
SIMPLE PROGRAMMING FOR ONE DIMENSIONAL AND TWO DIMENSIONAL ARRAYS EX: NO: 06 (a)
FIND THE SUM OF ARRAY ELEMENTS
FLOWCHART:
start
Read n
I=0;I<N;I++
I=0;I<N;I++
Read a[i]
sum=sum+a[i];
Print sum
stop
The Sum of Array Elements is 280 RESULT: Thus the menu driven c program to find the sum of given array elements was written, entered, executed and the output was verified.
EX: NO: 06 (B) FIND MINIMUM AND MAXIMUM OF ARRAY ELEMENTS FLOWCHART:
start
I=0;I<N;I++
I=0;I<N;I++
stop
RESULT: Thus the c program to find the max and min of given array elements was written, entered, executed and the output was verified. .
FLOWCHART:
J=0 start Is j<n
J=j+1
Is j<n
C I=i=1
C[i][j]=0 F
I=0
stop Is i<m
J=0 D
c[i][j]=c[i][j]+ a[i][k]*b[k][j]
I=i+1
Print c[i][j]
RESULT: Thus the c program to perform 2*2 matrixes multiplication was written, entered, executed and the output was verified.
TRANSPOSE OF A MATRIX
FLOWCHART:
start
for(i=0;i<row;i++) for(j=0;j<col;j++)
Read a[i][j
for(i=0;i<row;i++)
Print a[i][j]);
for(i=0;i<row;i++
Print a[i][j]);
stop
RESULT: Thus the c program to perform transpose of a matrix was written, entered, executed and the output was verified.
FLOWCHART:
J=j+1
Is j<n
C I=i=1
C[i][j]=0 F
I=0
stop Is i<m
J=0 D
a[i][j]+b[i][j];
I=i+1
Print c[i][j]
RESULT: Thus the c program to perform 2*2 matrixes addition was written, entered, executed and the output was verified.
EX: NO: 07 SOLVING PROBLEMS USING STRING FUNCTIONS (a) STRING PALINDROME CHECKING
:
FLOWCHART:
start
Read string S
strcmp(s, s1)==0
palindrome
stop
RESULT: Thus the c program to check whether the given string is palindrome or not was written, entered, executed and the output was verified.
STRING CONCATENATION
Start
strcat(S1,S2)
Stop
RESULT:
Thus the c program to find the length of given two strings and concatenate them was written, entered, executed and the output was verified.
Read s1,s2
Strcmp (s1,s2)
false
stop
RESULT: Thus the c program to compare two string using strcmp() function was written, entered, executed and the output was verified.
FLOWCHART:
Start
strcpy(S2,S1)
Stop
RESULT: Thus the c program for copying two string using strcpy() function was written, entered, executed and the output was verified.
FLOWCHART:
Start
Print S1,S2,S3,N
Stop
RESULT: Thus the c program for converting to lowercase,uppercase and finding string length was written, entered, executed and the output was verified.
EX: NO: 08 PROGRAMS WITH USER DEFINED FUNCTIONS (a) FUNCTIONS WITHOUT ARGUMENTS & RETURN TYPE
FLOWCHART:
start
Read year yr
yr%4==0
Leap year
stop
Thus the c program to check whether the given year is leap or not using functions was written, entered, executed and the output was verified.
EX: NO: 08 (b) FUNCTIONS WITHO UT ARGUM ENTS & WITH RETURN TYPE
FLOWCHART:
start
Read a,b,c
s=(a+b+c)/2
ar=sqrt(s*(s-a)*(s-b)*(s-c));
Print ar
stop
RESULT: Thus the c program to calculate the area of triangle using functions was written, entered, executed and the output was verified
EX: NO: 08 (c) FUNCTIONS WITH ARGUMENTS & WITHOUT RETURN TYPE
FLOWCHART:
start
Read element n
a[i]>a[j]
stop
RESULT: Thus the c program to sort the given array of elements using functions was written, entered, executed and the output was verified.
FLOWCHART:
start
Read element n
s=a[i]
s=small(a,n)
stop
RESULT: Thus the c program to find the smallest element of given array of elements using functions was written, entered, executed and the output was verified.
FACTORIAL OF A NUMBER
Read number n
n==0 || n==1
n*factorial(n-1)
Return 1
stop
SUM OF DIGITS
Read number n
n<10
Return n
s=sum(n,s);
stop
RESULT: Thus the c program to find the sum of digits of a given number was written, entered, executed and the output was verified.
EX.NO:9(c)
FLOWCHART:
start
stop
RESULT: Thus the c program to find the recursive function of a Fibonacci serieswas written, entered, executed and the output was verified.
FLOWCHART:
start
rev = getReverse(str);
*str
stop
RESULT: Thus the c program to find the recursive function of reversing the given string was written, entered, executed and the output was verified.
STUDENT
s.avg=(s.m1+s.m2+s.m3)/3;
stop
RESULT: Thus the c program to maintain the student record using structures was written, entered, executed and the output was verified.
ARRAY OF
start
s[i].rno==a
Print rollno,name,dept,marks
stop
RESULT: Thus the c program to maintain various number of students record using array of structures was written, entered, executed and the output was verified.
FLOWCHART:
start
stop
RESULT:
Thus the c program to store the book information using union was written,