Varma C Question
Varma C Question
Varma C Question
1. Write a C program to compute the perimeter and area of a rectangle with a height of 7 inches and
width of 5 inches.
Exercise 2:
2. Write a C program that accepts 4 integers p, q, r, s from the user where r and s are positive and p is
even. If q is greater than r and s is greater than p and if the sum of r and s is greater than the sum of p
and q print "Correct values", otherwise print "Wrong values".
Exercise 3:
2. Write a program in C which is a Menu-Driven Program to compute the area of the various geometrical
shape.
Exercise 4:
1. Write a program in C to display the first n even natural numbers and their sum.
2. Write a program in C to display the n terms of harmonic series and their sum. 1 + 1/2 + 1/3 + 1/4 + 1/5
... 1/n terms.
Exercise 5:
Exercise 6:
1. Write a program in C to print maximum element in each row and each column of a given matrix.
Exercise 8:
1. Write a program in C to compare two strings without using string library functions.
Exercise 9:
1. Write a program in C to check whether a number is a prime number or not using the function.
2. Write a program in C to get the largest element of an array using the function.
3. Write a program in C to convert decimal number to binary number using the function.
Exercise 10:
1. Write a program in C to demonstrate the use of & (address of) and *(value at address) operator.
Exercise 11:
Exercise 12:
1. Write a program in C to find the largest element using Dynamic Memory Allocation.
2. Write a program in C to count the number of vowels and consonants in a string using a pointer.
Exercise 13:
1. Write a C program to find sum of n elements entered by user. To perform this program, allocate
memory dynamically using calloc( ) function. Understand the difference between the above two
programs
2. Write a C program to find sum of n elements entered by user. To perform this program, allocate
memory dynamically using malloc( ) function.
Exercise 14:
Exercise 15:
Exercise 16: