Fun Facts
Image Title

c code to find max using + , - , div , abs.

write a c code to find max using + , - , div , abs.
Description :
Assume that you are given a rudimentary programming language which contains only four operators, viz., +, −, abs and div. + and − have their usual meanings, while div(a, b) returns the quotient of a/b and abs(a) returns the absolute value of a. Write a program to solve this problem by using a function max(a, b) that takes two integers a and b as input and returns the maximum of the two. Note that you can only use the operators provided; in particular, the constructs ”if”, “while”, or “for” are not available.
  • c
Image Title

c code function for computing ⌊√n⌋ for any +ve integer.

write a c code function for computing ⌊√n⌋ for any +ve integer.
Description :
Write a program using a function for computing ⌊√n⌋ for any positive integer. Besides assignment and comparison, your algorithm may only use the four basic arithmetic operations. Hints: In number theory, the integer square root (sqrt) of a positive integer n is the positive integer m which is the greatest integer less than or equal to the square root of n, sqrt(n)=⌊√n⌋
  • c
Image Title

c code to replace linked list with product of data

write a c code to replace linked list with product of data excluding itself
Description :
Write a program to display a linked list of n integers (n>1), where every index of the linked list should contain the product of all elements in the linked list except the element at the given index. Solve this problem by taking a single loop without an additional linked list. Input linked list : 3 4 5 1 2 Output linked list :40 30 24 120 60
  • c
  • linked list
Image Title

c code to swap pair of elements of a linked list

write a c code to swap pair of elements of a linked list
Description :
Write a program to swap pair of elements of a linked list of n integers from starting. If n is odd, then the last number will remain unchanged.
  • c
  • linked list
Image Title

c code to find second smallest and second largest in linked list

write a c code to find second smallest and second largest in linked list
Description :
Write a program to find out the second smallest and second largest element stored in a linked list of n integers. n is the user input. The array takes input through random number generation within a given range. How many different ways you can solve this problem. Write your approaches & strategy for solving this problem.
  • c
  • linked list
Image Title

c code to swap three numbers

write a c code to swap three numbers
Description :
Write a program that takes three variables (a, b, c) as separate parameters and rotates the values stored so that value a goes to be, b, b to c, and c to a by using SWAP(x,y) a function that swaps/exchanges the numbers x & y.
  • c
Image Title

c code to find duplicate and most repeating element

Write a program to store random numbers into an array of n integers, where the array must contains some duplicates.
Description :
Write a program to store numbers into an array of n integers, where the array must contain some duplicates. Do the following: a) Find out the total number of duplicate elements. b) Find out the most repeating element in the array.
  • c
Image Title

c code to find smallest and largest

write a c code to find smallest and largest in random number generated in array
Description :
Write a program to store random numbers into an array of n integers and then find out the smallest and largest number stored in it. n is the user input.
  • c
Image Title

c code for linear probing

write a c code for linear probing
Description :
WAP for linear probing // linear hashing.
  • c
Image Title

c code for number appears more than or equal to n/2 times

write a c code for number appears more than or equal to n/2 times
Description :
Given a sorted array of length n, WAP to find the number in an array that appears more than or equal to n/2 times. It can be assumed that such an element always exists. Input: 2 3 3 4 Output: 3 Input: 3 4 5 5 5 Output: 5
  • c
Image Title

c code for binary search

write a c code for binary search
Description :
WAP to read an array of integers and search for an element using binary search.
  • c
  • search
Image Title

c code for integer hunt

write a c code for integer hunt
Description :
Given an array container and integer hunt. WAP to find whether hunt is present in container or not. If present, then triple the value of hunt and search again. Repeat these steps until hunt is not found. Finally return the value of hunt. Input: container = {1, 2, 3} and hunt = 1 then Output: 9 Explanation: Start with hunt = 1. Since it is present in array, it becomes 3. Now 3 is present in array and hence hunt becomes 9. Since 9 is a not present, program return 9
  • c
Image Title

c code for quick sort.

write a c code for quick sort.
Description :
WAP to sort an array of n doubles in a descending order using quick sort.
  • c
  • sorting
Image Title

c code for merge sort.

write a c code for merge sort.
Description :
WAP to sort an array of n integers in an ascending order using merge sort
  • c
  • sorting
Image Title

c code for insertion sort.

write a c code for insertion sort.
Description :
WAP to sort an array of n integers in a descending order using insertion sort.
  • c
  • sorting
Image Title

c code for selection sort.

write a c code for selection sort.
Description :
WAP to sort an array of n floats in an ascending order using selection sort.
  • c
  • sorting
Image Title

c code for bubble sort

write a c code for bubble sort
Description :
WAP to sort an array of n dates in an ascending order using Bubble sort. Date structure is {day, month, year }
  • c
  • structure
  • sorting
Image Title

c code to sort stack using stacks

write a c code to sort stack using stacks
Description :
WAP to sort the elements inside a stack using only push and pop operation. Any number of additional stacks may be used.
  • c
  • stack
Image Title

c code for additional operations stack

write a c code for peekLowestElement ,peekHighestElement, peekMiddleElement in stack
Description :
WAP to implement a stack that will support three additional operations, in addition, to push and pop by modifying. a) peekLowestElement - return the lowest element in the stack without removing it from the stack b) peekHighestElement - return the highest element in the stack without removing it from the stack c) peekMiddleElement - return the (size/2+1)th lowest element in the stack without removing it from the stack.
  • c
  • stack
Image Title

c code for stack using one queue only

write a c code for stack using one queue only
Description :
Given one queue data structure. WAP to implement stack using only one queue data structure.
  • c
  • stack
  • queue
Image Title

c code to implement Deques using linked list

implement Deques using linked list
Description :
Write a menu-driven program to implement Deques (both Input-restricted and Output-restricted) operations such as Enqueue, Dequeue, Peek, Display of elements, and IsEmpty using a linked list.
  • c
  • linked list
  • Deques
Image Title

c code for queue using stack.

write a c code for queue using stack.
Description :
A stack data structure is given with push and pop operations. WAP to implement a queue using instances of stack data structure and operations on them.
  • c
  • queue using stack
Image Title

c code for stack using queue.

write a c code for stack using queue.
Description :
A queue data structure is given with enqueue and dequeue operations. WAP to implement a stack using instances of queue data structure and operations on them
  • c
  • stack_using_queue
Image Title

c code for queue using linked list.

write a c code for queue using linked list.
Description :
Write a menu-driven program to implement queue operations such as Enqueue, Dequeue, Peek, Display of elements, and Is Empty using a linked list.
  • c
  • queue using linked list
Image Title

c code for queue using array

write a c code for queue using array
Description :
Write a menu-driven program to implement queue operations such as Enqueue, Dequeue, Peek, Display of elements, Is Empty, and IsFull using a static array.
  • c
  • array_queue
Image Title

c code for parenthesis matching

write a c code for parenthesis matching
Description :
Two brackets are considered to be a matched pair if the opening bracket (i.e., (, [, or { ) occurs to the left of a closing bracket (i.e., ), ], or }) of the exact same type. There are three types of matched pairs of brackets: [], {}, and (). A matching pair of brackets is not balanced if the set of brackets it encloses are not matched. WAP to determine whether the input sequence of brackets is balanced or not. If a string is balanced, it prints YES on a new line; otherwise, print NO on a new line. Example: Input: {[()]} and Output: YES Input: {[(])} and Output: NO
  • c
  • bracket matching
Image Title

c code for infix to postfix conversion

implement of infix to postfix and prefix conversion
Description :
WAP to convert an infix expression into its equivalent postfix notation and into its equivalent prefix notation
  • c
  • array_stack
Image Title

c code for stack using linked list

implement stack using linked list
Description :
Write a menu driven program to perform the following operations of a stack using linked list by using suitable user-defined functions for each case.
  • c
  • stack
  • linked_list_stack
Image Title

c code for stack using array

implement stack using array
Description :
Write a menu-driven program to perform the following operations of a stack using an array by using suitable user-defined functions for each case. a) Check if the stack is empty b) Display the contents of the stack c) Push d) Pop
  • c
  • stack
  • array_stack
Image Title

c code for sparse matrix .

write a c code for sparse matrix .
Description :
Write a program to determine whether the given matrix is a sparse matrix or not.
  • c
  • sparse matrix
Image Title

c code to add polynomials using linked list

write a c code to add polynomials using linked list
Description :
Write a program to add two polynomials with a single variable. Write a function to create & display the polynomial using a linked list and write a new function for addition operations.
  • c
  • linked list
Image Title

c code to rotate linked list by k nodes.

write a c code to rotate linked list by k nodes.
Description :
Given a singly linked list, rotate the linked list counter-clockwise by k nodes. Where k is a given positive integer. For example, if the given linked list is 10->20->30->40->50->60 and k is 4, the list should be modified to 50->60->10->20->30->40. Assume that k is smaller than the count of nodes in linked list.
  • c
  • linked list
Image Title

c code to check whether cyclic Linked List or not.

write a c code to check whether cyclic Linked List or not.
Description :
A linked list is said to contain a cycle if any node is visited more than once while traversing the list. WAP to detect a cycle in a linked list.
  • c
  • linked list
Image Title

c code for mth linked list.

write a c code to print mth linked list.
Description :
Write a program to print the mth node from the last of a linked list of n nodes.
  • c
  • linked-list
Image Title

c code for linked list reverse

write a a code for inked list reverse
Description :
Write a program to display the contents of a linked list in reverse order.
  • c
  • linked-list
  • reverse
Image Title

c code for single linked list

implement single linked list
Description :
Write a menu-driven program to perform the following operations in a single linked list by using suitable user-defined functions for each case. a) Traversal of the list. b) Check if the list is empty. c) Insert a node at a certain position (at beginning/end/any position). d) Delete a node at a certain position (at the beginning/end/any position). e) Delete a node for the given key. f) Count the total number of nodes. g) Search for an element in the linked list. Verify & validate each function from the main method
  • c
  • linked list
Image Title

c code for dynamic square matrix

write a c program for dynamic square matrix
Description :
Let A be nXn square dynamic matrix. WAP by using appropriate user-defined functions for the following: a) Find the number of nonzero elements in A b) Find the sum of the elements above the leading diagonal. c) Display the elements below the minor diagonal. d) Find the product of the diagonal elements.
  • c
  • matrix
Image Title

c code

write a c code to find largest and occurrence in array using single loop.
Description :
WAP to find the largest number and counts the occurrence of the largest number in a dynamic array of n integers using a single loop.
  • c
  • largest,ocurrence
Image Title

c code to replace with multiplication

write a c code to replace with multiplication in array.
Description :
WAP to replace every dynamic array element by multiplication of previous and next of an n element.
  • c
Image Title

c code to replace with next greatest element

write a c code to replace with next greatest element.
Description :
Write a program to replace every element in the dynamic array with the next greatest element present in the same array
  • c
  • NGE
Image Title

c code for even after all odd numbers

write a c code to even after all odd numbers
Description :
WAP to arrange the elements of a dynamic array such that all even numbers are followed by all odd numbers.
  • c
  • even-odd
Image Title

c code to find minimum distance between two numbers

write a c code to find minimum distance between two numbers
Description :
Given an unsorted dynamic array arr and two numbers x and y, find the minimum distance between x and y in arr. The array might also contain duplicates. You may assume that both x and y are different and present in arr. Input: arr[] = {3, 5, 4, 2, 6, 5, 6, 6, 5, 4, 8, 3}, x = 3, y = 6
  • c
Image Title

c code to store employee’s data

write a c code to store n employee’s data with details.
Description :
WAP to store n employee’s data such as employee name, gender, designation, department, and basic pay. Calculate the gross pay of each employee as follows: Gross pay = basic pay + HR + DA HR=25% of basic and DA=75% of basic.
  • c
  • employee
Image Title

c code for next greater element

write code for next greater element in c
Description :
2. Given a dynamic array, WAP prints the next greater element (NGE) for every element. The next greater element for an element x is the first greater element on the right side of x in the array. For elements for which no greater element exist, consider the next greater element as -1. E.g. For the input array [2, 5, 3, 9, 7], the next greater elements for each element are as follows.
  • c
  • NGE
Image Title

c code

given unsorted dynamic array of size n , find and display the number of elements between two elements a and b.
Description :
Given an unsorted dynamic array of size n, WAP to find and display the number of elements between two elements a and b (both inclusive). E.g. Input : arr = [1, 2, 2, 7, 5, 4], a=2 and b=5, Output : 4 and the numbers are: 2, 2, 5, 4
  • c
Image Title

c code for library system

write a code for library management system
Description :
Let us work on the menu of a library. Create a structure containing book information like accession number, name of author, book title and flag to know whether book is issued or not. Create a menu in which the following can be done. A.- Display book information B- Add a new book C - Display all the books in the library of a particular author D - Display the number of books of a particular title E - Display the total number of books in the library F- Issue a book (If we issue a book, then its number gets decreased by 1 and if we add a book, its number gets increased by 1).
  • c
  • library
Image Title

c code

write a code foe company employees in c
Description :
3. Write a structure to store the names, salaries, and hours of work per day of 10 employees in a company. Write a program to increase the salary depending on the number of hours of work per day as follows and then print the name of all the employees along with their final salaries. For Hours of work per day 8, 10, >=12, Increase in salary Rs. 5000, Rs. 10000, Rs. 150000 respectively.
  • c
  • structure
Image Title

c code

write a program to store details of 12 student in c
Description :
2. Write a program to read the Roll number, Name, Address, Age & average marks of 12 students in the class and display the details from the function.
  • c
  • structure
Image Title

c code for complex numbers

write a c code for complex numbers using structures
Description :
1. Define a structure “complex” (typedef) to read two complex numbers and perform addition, and subtraction of these two complex numbers, and display the result.
  • c
  • structure
  • complex number
Image Title

c code to reverse integer (recursion)

how to reverse integer in c using recursion
Description :
write a program to read an integer number and print the reverse of that number using recursion.
  • c
  • reverse
  • recursion
Image Title

c code to reverse integer

how to reverse integer in c using functions
Description :
write a program to read an integer number and print the reverse of that number.
  • c
  • reverse
Image Title

c code for struture

create a structure named Company with deatils of it.
Description :
write a prog to create a structure named Company with a name, address, phone, and no of Employee as a member variable. Read and display all these member variables.
  • c
  • structure
  • functions
Image Title

c code for prime Armstrong perfect numbers

find prime Armstrong perfect numbers in c
Description :
Using the function, write a program to find whether a number is prime, Armstrong, or perfect.
  • c
  • prime, Armstrong number
  • perfect number
Image Title

c code for swapping

how to swap in c using call by value and reference
Description :
write a program to swap two integers using call by value and call by reference method by passing argument to the function.
  • c
  • swapping
  • by value ,reference
Image Title

c code to + , - , / , *

implement add , subtract , multiply and divide in c
Description :
Write a program to add subtract, multiply and divide two numbers using user-defined functions with the return type.
  • c
  • + , - , / , *