Cs Practical File
Cs Practical File
-L
Q1.WAP to compute xn of
given two integers x and n
Source Code:
Output:
Q2.WAP for calculating
simple interest
Source Code:
Output:
Q3.WAP to accept a number from
the user and display whether it is an
even number or Odd number
Source Code:
Output:
Q4.WAP to accept the day of the
week from the user and print the
day of the week in words
Source Code:
Output:
Q5.WAP to check whether the
given year is leap year or not
Source Code:
Output:
Q6.WAP to take accept two numbers
and operator from the user and
create a menu to provide four
functions of a calculator (+,- ,* , /)
Source Code:
Output:
Q7.WAP to accept a character
from the user and check whether it
is a letter, digit, space, or a special
character.
Source Code:
Output:
Q8.WAP to accept three numbers
from the user and display the
largest and the smallest number
(using relational operators)
Source Code:
Output:
Q9.WAP to accept percentage of a
student and display corresponding
grade based on the criteria specified
in the table given below:
Source Code:
Output:
Q10.WAP to find the sum and
product of first N natural
numbers
Source Code:
Output:
Q11.WAP to find and display
the sum of first N even and
odd numbers
Source Code:
Output:
Q12.WAP to print all the
factors of a given number.
Source Code:
Output:
Q13.WAP to print all the numbers
in the given range divisible by a
given number Num.
Source Code:
Output:
Q14.WAP to print the series
1,3,5,7,9....N
Source Code:
Output:
Q16.WAP to accept a number
from the user and check if it is
a palindrome or not.
Source Code:
Output:
Q17.WAP to print Fibonacci
series up to a certain limit.
Source Code:
Output:
Q18.WAP to display prime
numbers up to a certain limit.
Source Code:
Output:
Q19.WAP to accept a number,
find and display whether it’s
an Armstrong number or not.
Source Code:
Output:
Q20.WAP to print the sum of
the series 1+x1 /1!+x2
/2!+…….xn /n! [Exponential
series]
Source Code:
Output:
Q22.WAP to accept a string (a
sentence) and returns a string
having first letter of each
word in capital letter
Source Code:
Output:
Q23.Write a program that accepts a string.
Count and print the following present in the
Source Code: given string
Output:
Q24.Write a menu driven program
that implements nested loop to
print any pattern based on user’s
choice (Any Three)
Source Code:
Output: