You are on page 1of 7

NAME: MUHAMMAD MUZAMMIL

S.NO# 33
DATE:3/4/19

Q1) write a program that will having 2 integer constants,2 float


constants and 2 character constants and at the time of declaration
define the in the following format.
FORMAT:
Int 1 int 2

Float2 float 1

Char 1 char 2

Char 1 int 1 float 1

Float 1 char 2 int 2

SOURCE CODE:
OUTPUT:

Q2) Write a program that will be having 2 char 3 float declare at the time of definition
and display them in the following order:-

FORMAT:
__

__

Float 1 [8 spaces] character 1

Char 2 [8 spaces] float 2 [8 spaces] float 3

__

Char 1 [8 spaces] char 2

__

__

Float 1 [8 spaces] float 2 [8 spaces] float 3

SOURCE CODE:
OUTPUT:

Q3) Write program to taking two integers as input and display them in following order:

FORMAT:
int1
int2
_
_
int1 [8spaces] int2

SOURCE CODE:
OUTPUT:

Q4) Write program to taking one character, one float, two integers as input and display
them in following order:

FORMAT:
Char

int2 [8spaces] int1

float

char [8spaces] float [8spaces] int1 [8spaces] int2


SOURCE CODE:

OUTPUT:
Q5) Write program to take two integers as input and calculate their sum and display in this
order:-

FORMAT:
First No: value of first number
Second No: value of second number
Sum: sum of both values

SOURCE CODE:

OUTPUT:
Q6) Write program to take three integers as input and calculate sum if 1st and 3rd integer
and product of all three integers, Calculate double of sum and half of product and display
in this order:-

FORMAT:
Sum: first and last sum
Product: value of product
Double of sum: sum value *2
Half of product: product value/2

SOURCE CODE:

OUTPUT:

You might also like