Showing posts with label multifunctional. Show all posts
Showing posts with label multifunctional. Show all posts

Queue implementation using array

Problem statement
Write a c program to implement queue using array 
your program should have these functions 

  1. adding an element to queue
  2. deleting element from queue
  3. printing queue  

Storing numbers in a link list in decreasing order

Problem statement
Write a c program to store numbers in link list in decreasing order,
your program should also print them

Scanning numbers in link list using recursion

Problem statement
Write a c program to recursively add element in a link list
your program should also print them recursively

Storing numbers in link list

Problem statement
Write a c program to store values using link list, your program should store the values in order they are entered and the print the values. total number of inputs will be given by user,
for example
total number of integer you will enter 5
1
2
3
5
1
then your program should print
1
2
3
5
1
and store in the same manner only, i.e. the number which will be entered in the list will be in the last of the list

Storing numbers using link list

Problem statement
Write a c program to store numbers using link list and then print them,the new number entered should be at the top of list

Calculatinf solution of an equation using Bisection Method

Problem statement
Write a program that uses the bisection algorithm to find  a root of 
the equation x2 − 2 = 0. 
The method of successive bisection works as follows: Start with a lower bound l and an 
upper bound u such that  f(l)*f(u) > 0, ie, f(l) and f(u) are of opposite signs. Then there is 
a foot of f(x) between l and u. Write a loop where in each iteration, you compute the 
middlepoint (mid) of the current interval [l, u]. Evaluate f(mid), and based on the sign of 
f(mid), change the current interval to [l, mid] or to [mid, u]. The loop terminates when 
width of the interval becomes smaller than  10−6

Finding out SADDLE point

Problem statement
Write a c program to find out saddle point of a metrics
For a given m × n matrix A, the (i, j) the element is said to be a saddle
point if it is the maximum in row i and minimum in column j, or
minimum in row i and maximum in column j.
(a) Write a function int saddle (A, i, j) to test if the (i, j) the element
of the given matrix A is a saddle point or not. Choose the
function prototype in a suitable way, and use additional parameters,
if necessary. If the element is a saddle point, the function
must return 1; if not, it must return 0.
(b) Write a main function that would first read in an m × n matrix
A. Then all the saddle points of the matrix (along with their
positions) would be printed, using the function saddle(). Both
the given matrix and also the output should be printed in properly
formatted form.
(
     For a given m × n matrix A, the (i, j) the element is said to be a saddle
     point if it is the maximum in row i and minimum in column j, or
     minimum in row i and maximum in column j.
)
Run your program for the following two matrices:
7 5 12 17
8 16 9 22
3 20 7 30
5 11 54 20

12 12 12 12 12
12 20 20 20 20
12 5 5 5 5

Decimal to Binary conversion

Problem statement
Write a c program to convert a decimal number to binary number using recursion

Decimal to binary conversion using recursion of an integer

Problem statement
Write a c program to print binary equivalent of an integer number using recursion,your program should not store binary part in any kind of array

Train reservation of one train

Problem statement
Write a c program to maintain reservation list of a train using link list,your program should do the following it should take the name,age,sex as input of a passenger, there are 50 seats in the train,and you can take up to 20 waiting list.
[click here for recursive]

Equality of strings using recursion

Problem statement
Write a c program to check weather two given strings are equal or not using recursion

Checking weather a number exist in other number or not

Problem statement
Write a c program to check weather  number1 exist in  number2 or not,number1 need not to be single digit number. Without using array.

Number Operations

Problem statement
Write a c program to do the following
1. int sumdigits (int num) : This function should take a decimal number as input and return the sum of digits
of the number.
2. int reverse (int num) : This function should take a decimal number and return the reverse number.
3. int palindrome (int num) : This function should return 1 if the input decimal number is a palindrome and
0 otherwise.
4. void findcommondigits (int num1, int num2) : This function should print the digits that are
common in two decimal numbers num1 and num2.
a. [Helper function] int occursdigit (int digit, int num) : This function checks if digit (0<=digit<=9) is
a digit in the decimal number num1
Type the following C program to test the above functions

Array Operation

Problem statement
Write a c program to do the following
Takes inputs from use and stores them in an array
search() :search an element in the array
sinsert(): insert a element in the array
sdelete(): deletes given element from the array
printarray(): prints the array
intersection(): takes three array and stores intersection of two arrays in the third array
difference():takes three array and stores that element in the third array which are not common in two arrays

Reversing an array of numbers using Recursion

Problem Statement
Write a c program to reverse elements of an array of numbers using recursive function

Prime Number by Recursion


Problem Statement
Write a recursive c program to check weather a number is prime or not


Value of the function F(x) = 1 + 2/x + 3/x2 + 4/x3+...

Problem Statement
For a function F(x),

     F(x) = 1 + 2/x + 3/x2 + 4/x3+...

write a function float EvaluateFunc(float x, int n) where x > 1 and evaluate the function F(x) up to n terms.


Program to Print Power Set of Numbers

Problem Statement
Write a c program to print all the possible set of  numbers
you should take input from the user
If S is a set of n elements, the power set of S is the set of all possible subsets of S. For
example, if S = {a, b, c} , then power set(S) =  , {a} , {b} , {c} , {a, b} , {a, c }, {b, c} , {a, b, c }.
Write a recursive function to print the power set of a set of characters which are stored in
an array

Hard Prime Numbers

Problem Statement
A prime number is a number, which can be divided evenly only by 1 or
itself, and it must be greater than 1.
For example, 7 can be divided evenly only by 1 or 7, and 7 is greater than
1, so it is a prime number.
Let us call a prime number is hard if its sum of digits (in decimal
convention) is also prime. For example, 23 is a hard prime, but 13 is not.
Write a full program implementing the following functions:
(i)
checkPrime: It takes a number as a parameter and returns 1 if it is
a prime number, else it returns 0.
(ii)
addDigit: which takes a number as parameter and returns its sum
of digit.
(iii) A main function which reads a number N, and prints all the hard
primes and their number (counting them) till N.

Structure Updating

Problem Statement
Write a c program to construct a structure, which holds second,minute,hour
take these value from user and assign them.
construct a function update which increases the time by one second each time