Practice Questions On Arithmetic Operators and Typeconversion
Practice Questions On Arithmetic Operators and Typeconversion
Write a C program that takes two integers from the user and performs a combination of arithmetic
operations. Compute the result of:
Result=(a+b)×(a−b)
Q2. Write a program that takes five numbers as input and calculates their average
Q3. Write a program to find power raised to the base number using pow() function
Q4. Write a program to swap two numbers using arithmetic operators (without using third variable)
Q5. Write a C program to print the ASCII value of a given character(take input from user)
Q6. Write a C program that takes two integers from the user and divides them. Perform explicit type
conversion to display the result as a floating-point number.
Q7. Write a program that takes a character from the user and prints its corresponding ASCII value using
type conversion.
Q8. Write a program to take two characters as input, convert them to their ASCII values, and print their
sum.