0% found this document useful (0 votes)
13 views38 pages

C File

B

Uploaded by

pandeyyash041
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views38 pages

C File

B

Uploaded by

pandeyyash041
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 38

C - LANGUAGE CODES

Program 1: WAP of printing hello C language.


Algorithm:

Flowchart :

Code :
Output :

Program 2: WAP to print cube of a number.

Algorithm :
Flowchart :

Code:
Output :

Program 3: WAP to find factorial of a number .


Algorithm :

Flowchart :

Code :
output :

Program 4: WAP to find addition , subtraction ,


multiplication , division , remainder of 2
numbers.
Algorithm :

Flowchart :
Code:

Output :

Program 5: WAP to find whether a number is prime or


not ?
Algorithm :

Flowchart :
Code:

Output :

Program 6 : WAP to find sum of geometric series .


Algorithm :
Flowchart :

Code :
Output :

Program 7: WAP to design a unary operator


calculator.
Algorithm :

Flowchart:

Code and Output :


Program 8: WAP to swap two numbers
using temporary variable.
Algorithm:
Flowchart:

Code and Output :


Program 9: WAP to swap two numbers
without using temporary variable
Algorithm:
Flowchart :
Code and Output :
Program 10: WAP to design a bitwise
operator calculator.
Algorithm:

Flowchart:
Code :

Output :
Program 11: WAP to find largest of three
numbers using conditional operator.
Algorithm :

Flowchart :
Code and Output :
Program 12: Write a menu driven program for matrices
to do the following operations depending on whether the
operation requires one or two matrices.
(a) Addition of two matrices
Code :

Output :
(b) subtraction of two matrices
Code :

Output :
(c) Finding upper and lower triangular matrices
Code:

Output :
(d) Transpose of a matrices
Code:

Output :

(e) Product of two matrices


Code:

Output :
Program 13: WAP to input no. from the user
& calculate the sum of a digit in a given no.
Algorithm :

Flowchart :
Code and Output :

Program 14: WAP to create a half pyramid


of alphabets .
A
BB
CCC
DDDD
EEEEE

Algorithm :

Flowchart :
Code and Output :
Program 15: WAP to print inverted full
pyramid of * .
*********
*******
*****
***
*
Algorithm :
Flowchart :

Code:
Output :

Program 16: WAP to convert decimal


number to binary no.s using while loop .
Algorithm :

Flowchart :

Code and Output :


Program 17: Write a C program to understand
the concept of Call by value and reference.
Algorithm :
Flowchart :

Code :
Output :

You might also like