Bbmvexnn ff
IPhis basie salary is less than Rs. 1500, then HRA ~ 10% of basie salary and DA = 90%
c salary. If his salary is either equal to or above Rs. 1500, then HRA ~ Rs, $00 and DA,
Se No. PORTE cook . char Signat
entered capital, small, digit or special character.
2 erect oft i ator
3% ap
r
7
z ee preg = fs
9. Jo “1 "35555 “A
“ 444 AB.
w 333 ABC
vee 2 ABCD
eased f ABCDE”
10 | PROG. TORRINTSWHOF THE SERIES] -1/2413
11 | PROG, TO,FIND THE SUM OF SERIES. XX 3 FAX GSSINITTION OO on lens
12) program by using functions .
a oa
Tala zs
15 sete
16 5 . a
7 5 : - r
18 [ap is ‘.
19 | Wap sa check if aed ica palind:
DO Wap ia Gada nes ward
21 | wap - tenath
22.) using a user defined funetion and menu driven program. “ .
of basic salary38,
Wiite a program 1m C to store n elements i an array and print the elements using pomnter
29. “Writea program iC to ind The Targest clement in-an-array using Dynamic Memory
Allocation(mallct) and free) functions)
SUC [Waite a program in C to print a srg hn VEE WATE POT
TT] Write a program in CTo count The nuniber of vowels and consonants 8 STAG ISIN @
pointer
32] WAP to read and print employes details Tike Employes 1D, E Name, salary ising SruSTUReS
35. | Create a structure sem (char iem_name[TO]ant qiy.Toat price oat Toral_amty. Enter
details regarding items, Create a pointer variable *pitem ofa structure item and access the
elements or members ofa structure using pointer variable by using -> operator
34] Create a stroture student (chamamel [O|int marks[3],jnt Tora and Moat perecnlagey, Emice
the marks of 5 students in 3 subjects and calculate the percentage .(Hint-Use the concept of
array of structure)
cs a structure Distance int Toc and Moat inch), Take two distances as Tapa from aver
and ad them (inch and feet separately), Display total distance in feets and inches,
36 Create a union union Data {int iflot char st[20]}.WAP vo show how to avcess and
print members of union and also print the maximum memory occupied by union members
37] WAP to add wo numbers with the help of Command linea
38] Write a program in C to create and store information in a text fileusing fprint and feant
functions)
39] Writea program in C to
functions) create and store information in a binary fle(using fread andl frite
4D Write a program in Cte
functions) te and store information in a data Hile(usin
47 Write a program in C10
functions) create and store information in a data file(using fgets and fputsite and store information in a data file(using getw and putw
447] Write a program in C to count a number of words and characters in a file
45,] Write a program in C to merge two files and write it ina new file
46,[ WAP in Cto show the functionality of fell Q and rewind) functions of file handli
47) WAP in C that takes the file nan
humbers from | 0 10, Create two more files “even” and “odd” , ead the contents of
“data” and check whether the number is even and odd and copied the same in to * even’
and “oda” file.
‘as an input from user, ereate a file “data” to store integer
48] WAP in Cio show the use of calloc() Function:
49.| WAP TO SHOW THE USE OF FOLLOWING DIRECTIVES #1F, #ELSE AND #ENDIF
INC
WAP TO SHOW THE USE OF STRINGIZE (#) AND
OPERATOR IN C TOKEN PASTING (
Write a program in C10
functions)
WAP in C to show the funetionality of fseek function1A character is entered through keyboard, WAP to determine whether the character is
entered capital, small, digit or special character.
OUTPUT
1)Enter a Character
A
A isan Uppercase Alphabet
2)Emter a Character
h
his an lowerease Alphabet
3) ter a Chat
2 is a Number
4)Enter a Character
(a is.a Special Character
ional operators.
2, WAP to find the largest of 3 nos. using condi4OWAP GOT calculate the Armstrong nos. b/w 1 and 500.
Enier throe different numbers: 5 67
7.000 is the largest number.
3.WAP to check whether a entered year is leap year or not.
OUTPUT
Enter a year: 1996
1996 is a leap year
371 is a Arms
407 is a ArmstraOUTPUT
Enter a positive integer: 39
39 is not a prime number
2)Enter a positive integer: 29
29 isa prime number
6.WAP to find diameter, circumference and area of a circle using functions
OUTPUT
Enter the radius of a cirele : 7
14,00
Circle = 43.98
3.94
Area Of a Circle7.WAP to find max and min element of array
OUTPUT
Enter elements in the array: 23
31
24
s4
65
132
1
420
786
132
M1
Maximum element
8. A five digit no. is taken input from user, write a program to reverse that number and
find sum of the digit of its digit’ too.OUTPUT
Enter a five-digit number: 23456
Reverse of no. is
Sum of the digits of 23456 is: 20
sees
9.WAP to print the following patterns.
on “1 5
“A
12 AB
123 333 ABC
1 ire 123. 23 ABCD
* 13345” * ABCDE”
OUTPUT
Enter number of rows ~ §
*
we
wensOUTPUT
Enter number of rows= $
OUTPUT
Enter number of rows= 5
44d
333OUTPUT
Enter number of rows= §
A
AB
ABC
ABCD
ABCDE
10.PROG. TO PRIN]
JM OF THE SERIES
pane! areca in” terms.
OUTPUT
Liorseamutider of tems to print series 1
W-t2+1
Sum of Series upto terms : 0.783333
11.PROG. TO FIND THE SU Ml 6 s HX45/5 seal
~“X-X43/3 IEXAT/TIF+X49/91
“terms.OUTPUT
Input the value of x :2
Input number of terms :
The values of the series:
The Sum 410
12.WAP to do Linear Search, Binary search, Bubble Sort, Selection Sort using menu
driven program by using functions.OUTPUT
Enter no. of elements u want to sort
Enter | Element : 13
Enter 2 Element : 4
Enter 3 Element : 16
Enter 4 Element : 3
Enter 5 Element : 21
Please select any option Given Below for Sortin
Bubble Sort
2. Gelection Sort
3. Insertion Sort
4. Display Array
5S. Exil the Program
Enter your Choice : 4
13 4 16 3 21
1. Bubble Sor
2, Selection Sort
3. Insertion Sort
4. Display Array.
5. Enil the Pro
Enter your Choice : 1
Afier Bubble sort Elements are: 34 13 16 21
1. Bubble Sort
2. Selection Sort
3. Insertion Sort
4. Display Array
5. Exil the Program.
Enter your Choice : 2
Afier Selection sort Elements are: 3 4 13 1621
1. Bubble Sort
2. Selection Sort
3. Insertion Sort
4. Display Array
5. Exil the Program,
Enter your Choice : 3
After insertion sort Elements are 3 413 1621
1. Bubble Sort
2. Selection Sort
3. Insertion Sort
4. Display Array
5. Exit the Program.
Enter your Choice13.WAP to print table of any no. entered by the user.
OUTPUT
er:
Enter an integ
4rd
12
16
20
24
28
32
*9=36
4° 10-40
14.Wap to check whether the input character is a vowel or not using switch case.OUTPUT
1)Enter any alphabet: u
Vowel
2)Emter any alphabet: £
Consonant
15.WAP to insert and delete an clement to and from array at specified position
Input the size of array : 8
Input 8 elements in the array in ascendi
5:56
element - 6: 72
element - 7: 108
Input the position where to delete: 4
The new listis. 4121805672 116.WAP to print first 20 nos. of fibonacci seri
UTPUT
Fibonacer Series: 0, 1, 1, 2,3,$, 8, 13, 21, 34, $5, 89, 144, 233, 377, 610, 987, 1597, 1
17.WAP to find the sum and product of 2 matrix using function( user dOUTPUT
Enter rows and column for first matrix:
Enter rows and column for second matri
Enter elements of matrix |
Enter elements all: |
Enter elements a2: 2
Enter elements a3: 3
Enter elements a2: 2
Enter elements 022: 3
Enter elements a23: 4
Enter elements a31: 3
Enter elements 032: 4
Enter elements 033: $
Enter elements of matrix 2
Enter elements bl 1: 5
Enter elements b12: 4
Enter elements b13: 3
Enter elements b21: 4
Enter elements b22: 3
Enter elements b23: 2
Enter elements b31: 3
Enter elements b32: 2Enter elements b33: 1
Ouipur Marin
2°t6 10
18,WAP to find the LCM and GCF of 2 entered numbers.
Cees
OUTPUT
Enter two integers
48 296
Greatest common divisor of 48 and 296 = 8
Least common multiple of 48 and 296 ~ 1776
20.WAP to check if a given word is a palindrome or not.OUTPUT
Enter a string: Akshat
‘Akshat is not a palindrome
Enter ATGTA
ATGTA is.a palindrome
21.WAP to find a no of words in a string,
OUTPUT
Enter the string:
Akshat is awesome and he is the best guy
Number of words in given string are: 9
ring, concatenate two strings, length of a string, copy one string to
ined function and menu driven program.
22,.WAP to reverse a
other using a user deOUTPUT
Enter any option
1: Find out length of the string
2: Concatenate of the two sting
3: Reverse of the string
4: Copy of the string
Enter the choice:
Enter any strin
Awesome:
2)Emter any option
1: Find out length of the string
2 Concatenate of the two str,
3: Reverse of the string
4: Copy of the string
Enter the choice:
String Coneatenation
Enter the First string
ATGEnter Second string GTA
The Coneatenated string is ATGGTA,
3)Enter any option
1: Find out length of the string
2: Concatenate of the two strin
3: Reverse of the stri
4: Copy of the string
Enter the choice:
Reverse the strn
Enter the string Eggis
E
any option
4)En
1: Find out length of the str
Concatenate of the two stein
3: Reverse of the str
4: Copy of the string
Enter the choice:
String eopyin,
Enter Ist string :Awesome
Enter 2st string :Hero
Hero
23.1 a company an employce is paid as under:
If his basic salary is less than Rs. 1500, then HRA 10% of basic salary and DA 90% of
basic salary, Hf his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA
= 98% df Basie salary.
OUTPUT
Enter basic salary:1000
You Entered Basic Salary ~ 1000.00HRA = 100.00
DA =900.00
Gross salary = Rs, 2000.00
2)Emter basic salary:3000
You Entered Basic Salary ~ 3000.00
HRA ~ 500.00
DA = 2940.00
Gros
6440.00
24.WAP (o find the sum of the elements of array using pointers
OUTPU
Sum of array elements is:28
25.WAP to check whether a given number is perfect number or not.
OUTPUT
Enter a number
153 is not a Perfect Number2)Enter a number : 6
Gis nota Perle
amber
26.WAP to calculate factorial of a number using recursion.
OUTPUT
Enter a positive integer: 7
Factorial of 7 = S040
27.Write a program
C to swap ciements using call by reference.
OUTPUT
Enter a, b and ¢ respectively: 4 8 12
Value before swapping
a=4
b=8afier swapping
28.Write a program in C to store n elements in an array and print the elements using
pointer.
OUTPUT
Ener the umber of clemems 30) 10
Ener loan 261013 162 28 5440 8
voneaored
“6
6
12
ig
28
34
40
50
29.Write a program in C to find the largest element in an array using Dynamic Memory
Allocation(malloc() and free() functions).OUTPUT
Enter the total number of elements: §
Enter number! 12.4
Enter number2: -8.7
Enter number3: 9.2
Enter number: Enter numbers: -9.2
Enter number6: 17.5
Enter number?: 23.9
Enter number®: 4.1
L
st number = 23.90
30.Write a program in C to print a string in reverse using a pointer.
OUTPUT
ENTER A STRING: Captain Awesome
THE REVERSE OF THE STRING IS: emosewA niaipaC
34.Write a program in C to count the number of vowels and consonants in a string using
a pointer.Number of Consonants in Str
32.WAP to read and pr
structures
nt employce details like Employee ID, EName,
OUTPUT
Enter details
Name ?:Akshat
ID ?:4021
Salary 2:800000
Entered detail is:Name: Akshat Id: 4021 Salary: 800000,000000
lary using33.Create a structure item (char item_name|10],int qty.float price,float total_amt) . Enter
details regarding items. Create a pointer variable *pitem of a structure item and access
the elements or members of a structure using pointer variable by using -> operator.
OUTPUT
Enter product name: Asus Laptop
Enter price: 60000
Enter quantity: 5
Name: Asus Laptop
Price: 60000,000000
Quantity: 5
Total Amount: 300000,000000
34.Create a structure student (charname|10],int marks|3],,int total and float percentage).
Enter the marks of 5 students in 3 subjects and calculate the percentage .(Hint:Use the
concept of array of structure).OUTPUT
Enter information of students
For roll number:
8
Enter first name:
Enter marks: 94
Alen
For roll number:
9
Enter first name: Anant
Enter marks: 82
For roll number:
10
Enter first name: Akshat
Enter marks: 98.6
For roll number
ul
Enter first name: Joel
Enter marks: 88
For roll number
12
Enter first name: Vishrut
Enter marks: 99.8.
Displaying Information:
)Roll number: §
First name: AlenMarks: 94.0
2)Roll number: 9
First name: Anant
Marks: 82.0
3)Roll number: 10
First name: Akshat
Marks: 98.6
4)Roll number: 11
First name: Joel
Marks: 88.0
5)Roll number: 12
First name: Vishrut
Marks: 99.8
35.Create a structure Distance (int feet and float inch). Take two distan
user-and add them (inch and feet separately). Disp
input from
ay total distance in feets and inches.
OUTPUT
En st cisance
Enter fe fl
Frc inchs 8Enter 2ndl distance
Enter feet: 6
Enter inch: 2
Sum o}
38.Write a program in C to create and store information in a text file(using fprintf and
fscanf functions)
OUTPUT
Enter the id
Enter the name
Akshat
Enter the salary
500000
on. mp.tt
Md 4331
Name= Akshat
Salary= 900000.00
39,Write a program
fwrite functions)
C to create and store information in a binary file(using fread and40. Write a program in.C to create and store information in a data file(using gete and
pute functions)
prog
fputs functions)
42.Write a pr
putw functions)
te and store information in a data file(using getw and45.Write a program in C to merge two files and write it in a new file.
47.WAP in C that takes the file name as an input from user, create a file “data” to store
integer numbers from | to 10. Create two more files “even” and “odd” , read the contents
of “data” and check whether the number is even and odd and copied the same in to “
even” and “odd” file.OUTPUT
Enter number of elements: 4
Enter elements of array: 24.68
Sum=20
49.WAP-FO SHOW THE USE OF FOLLOWING DIRECTIVES #IF,
#ENDIFIN C
50.WAP TO SHOW THE USE OF STRINGIZE (#) AND TOKEN PASTING (##)
OPERATOR INC.
OUTPUT
This isa string without double quotes
2050