JNTUK R13 C PROGRAMMING LAB


a) Write a C Program to calculate the area of triangle using the formula

area = ( s (s-a) (s-b)(s-c))1/2 where s= (a+b+c)/2

b) Write a C program to find the largest of three numbers using ternary operator.

c) Write a C Program to swap two numbers without using a temporary variable.


a) 2's complement of a number is obtained by scanning it from right to left and complementing all the bits after the first appearance of a 1. Thus 2's complement of 11100 is 00100. Write a C program to find the 2's complement of a binary number.

b) Write a C program to find the roots of a quadratic equation.

c) Write a C program, which takes two integer operands and one operator form the user, performs the operation and then prints the result. (Consider the operators +,-,*, /, % and use Switch Statement)


a) Write a C program to find the sum of individual digits of a positive integer and find the reverse of the given number.

b) A Fibonacci sequence is defined as follows: the first and second terms in the sequence are 0 and 1. Subsequent terms are found by adding the preceding two terms in the sequence. Write a C program to generate the first n terms of the sequence.

c) Write a C program to generate all the prime numbers between 1 and n, where n is a value supplied by the user.


a) Write a C Program to print the multiplication table of a given number n up to a given value, where n is entered by the user.

b) Write a C Program to enter a decimal number, and calculate and display the binary equivalent of that number.

c) Write a C Program to check whether the given number is Armstrong number or not.


a) Write a C program to interchange the largest and smallest numbers in the array.

b) Write a C program to implement a liner search.

c) Write a C program to implement binary search

Exercise 6



a) Write a C program to implement sorting of an array of elements .


b) Write a C program to input two m x n matrices, check the compatibility and perform addition and multiplication of them



a) Write a C program to insert a sub-string in to given main string from a given position.


b) Write a C program to delete n Characters from a given position in a given string.

c) Write a C program to replace a character of string either from beginning or ending or at a specified location.

Exercise 8


a) Write a C program to concatenate two strings without using the built in functions.

b) Write a C program to compare two strings without using the built in functions.



a) Write C Programs to find the length of a string without using the built in functions

b) Write C Programs to find whether a given string is palindrome or not.



a) Write a C program to find both the largest and smallest number of an array of integers.

b) Write C programs illustrating call by value concept.

c) Write a C program illustrating call by reference concept.