You are on page 1of 4

Input two alphabets then decide second one is in uppercase or not.

(ASCII code for A is 65 and


for Z is 90)
For example:
Input first: 4
Input second: d
This is not in upper case
Input first: i
Input second: M
This is in upper case

Input a string then show its length is more than 10 characters or not.
For example:
Input a string: KUDCS
Its length is not more than 10 characters
Input a string: University of Karachi
Its length is more than 10 characters

Input an alphabet and then show its equivalent ASCII code.


For example:
Input an alphabet: A
Its equivalent ASCII code is: 65

Input four alphabets then show them in reverse order.


For example:
Input first: d
Input second: i
Input third: m
Input fourth: e
emid

Input a number and then show is it greater than or equal to15 or not.
For example:
Input a number: 9
It is not greater than or equal to 15
Input a number: 20
It is greater than or equal to 15

Input a number and then show KUDCS that number of times.


For example:
Input a number: 3
KUDCSKUDCSKUDCS

Input a number and then call a procedure which shows its double.
For example:
Input a number: 4
Its double is 8
Input a number then show series from this number to one in reverse order.
For example:
Input a number: 5
5
4
3
2
1

Input two strings and then show first one is greater or equal in length than second or not.
For example:
Input first: Ali
Input second: Riaz
First one is not greater or equal than second
Input first: Riaz
Input second: Ali
First one is greater or equal than second

Take input a string and then show letter ‘a’ after each alphabet.
For example:
Input a string: net
naeata

Input a string and then show its first four characters.


For example:
Input a string: University
Univ

Show following series: (ASCII code for A is 65 and for Z is 90)


A1B2C3D4…Z26

Take input an alphabet and then show that is it among asdf or not.
For example:
Input an alphabet: j
It is not in asdf
Input an alphabet: d
It is in asdf

Write a program to read a character and check whether it is vowel or not.


For example:
Input an alphabet: j
It is not a vowel
Input an alphabet: e
It is a vowel

Write a program to print the square of all numbers from 1 to 10.


1 2 9 16 25 36 49 64 81 100
Write a program to take input length and breadth of a rectangle and then show its area.
For example:
Input length: 4
Input breadth: 5
Area is: 20

Input two alphabets then show them 10 times


For example:
Input first: 4
Input second: d
4d4d4d4d4d4d4d4d4d4d
Input first: i
Input second: M
iM iM iM iM iM iM iM iM iM iM

Input three characters and then show middle one first, then last and then first one.
For example:
Input first: 4
Input second: d
Input third: A
dA4

Show following series:


AABC,BABC,CABC,DABC,EABC,…,ZABC

Take input a character and then decide is it digit or not (ASCII code for 0 is 48)
For example:
Input a character: i
It is not a digit
Input a character: 9
It is a digit

Take input a string and then show it one character per line.
For example:
Input a string: KUDCS
K
U
D
C
S

Take input a number and then show its next third number.
For example:
Input a number: 20
23
Input a number: 8
11
Show following series:
ZA,YB,XC,…,AZ

Show following series: (Using iterations)


14 13 12 11 10 9

Input a string and then display it 5 times.


For example:
Input a string: Logic
Logic
Logic
Logic
Logic
Logic

Input three numbers and then display their product.


For example:
First: 3
Second: 2
Third: 4
Their product is: 24

Continuously input characters until k is pressed. (ASCII code for k is 107)


For example:
asdfghjk
qwerk

Input values for length and breadth and then display area.
For example:
Input length: 3
Input breadth: 5
Area is: 15

Input a string and then show its last character.


For example:
Input a string: Pakistan
n
Input a string: Computer
r

You might also like