Semester 1 Archive

Visual log of C programming assignments. Search by filename or problem statement.

Write a C program that includes a user-defined function named isPrime with the signature  int isPrime(int num); The function should take an integer as a parameter and return 1 if  the number is prime and 0 otherwise.
View Code
assignment-p-01.c

Write a C program that includes a user-defined function named isPrime with the signature int isPrime(int num); The function should take an integer as a parameter and return 1 if the number is prime and 0 otherwise.

Write a C program that includes a user-defined function named isArmstrong with the  signature int isArmstrong(int num);. An Armstrong number is a number that is equal to  the sum of its own digits each raised to the power of the number of digits. For example,  153 is an Armstrong number because 1^3 + 5^3 + 3^3 = 153
View Code
assignment-p-02.c

Write a C program that includes a user-defined function named isArmstrong with the signature int isArmstrong(int num);. An Armstrong number is a number that is equal to the sum of its own digits each raised to the power of the number of digits. For example, 153 is an Armstrong number because 1^3 + 5^3 + 3^3 = 153

Write a C program that includes a user-defined function named isPerfect with the signature  int isPerfect(int num);. A perfect number is a positive integer that is equal to the sum of  its proper divisors, excluding itself. For example, 28 is a perfect number because the sum  of its divisors (1, 2, 4, 7, 14) equals 28.
View Code
assignment-p-03.c

Write a C program that includes a user-defined function named isPerfect with the signature int isPerfect(int num);. A perfect number is a positive integer that is equal to the sum of its proper divisors, excluding itself. For example, 28 is a perfect number because the sum of its divisors (1, 2, 4, 7, 14) equals 28.

Write a C program that takes an integer input representing a month (1 to 12) and a year.  Use a switch statement to display the number of days in that month, considering leap years.
View Code
assignment-p-04.c

Write a C program that takes an integer input representing a month (1 to 12) and a year. Use a switch statement to display the number of days in that month, considering leap years.

Write a C program that defines an array of integers, and includes a user-defined function named reverseArray with the signature void reverseArray(int arr[], int size);. The function should reverse the elements of the array.
View Code
assignment-p-05.c

Write a C program that defines an array of integers, and includes a user-defined function named reverseArray with the signature void reverseArray(int arr[], int size);. The function should reverse the elements of the array.

Write a C program that includes a user-defined function named findLargest with the signature int findLargest(int arr[], int size);. The function should take an array of integers and its size, and return the largest element in the array.
View Code
assignment-p-06.c

Write a C program that includes a user-defined function named findLargest with the signature int findLargest(int arr[], int size);. The function should take an array of integers and its size, and return the largest element in the array.

Write a C program that includes a user-defined function named binarySearch with the signature int binarySearch(int arr[], int size, int target);. The function should perform a binary search on a sorted array of integers and return the index of the target element if found, and -1 otherwise.
View Code
assignment-p-07.c

Write a C program that includes a user-defined function named binarySearch with the signature int binarySearch(int arr[], int size, int target);. The function should perform a binary search on a sorted array of integers and return the index of the target element if found, and -1 otherwise.

Write a C program that includes a user-defined function named countSetBits with the signature int countSetBits(int num);. The function should count and return the number of set bits (1s) in the binary representation of the given number.
View Code
assignment-p-08.c

Write a C program that includes a user-defined function named countSetBits with the signature int countSetBits(int num);. The function should count and return the number of set bits (1s) in the binary representation of the given number.

Write a C program that includes a user-defined function named setBit with the signature int setBit(int num, int position);. The function should set the bit at the specified position (0-indexed) to 1 and return the modified number.
View Code
assignment-p-09.c

Write a C program that includes a user-defined function named setBit with the signature int setBit(int num, int position);. The function should set the bit at the specified position (0-indexed) to 1 and return the modified number.

Write a C program that defines a structure Rectangle with attributes length and width. Include a user-defined function named calculateArea with the signature float calculateArea(struct Rectangle r);. The function should calculate and return the area of the rectangle.
View Code
assignment-p-10.c

Write a C program that defines a structure Rectangle with attributes length and width. Include a user-defined function named calculateArea with the signature float calculateArea(struct Rectangle r);. The function should calculate and return the area of the rectangle.

Write a C program that defines a structure Student containing the attributes rollNumber, name, and marks. Include a user-defined function named displayStudent with the signature void displayStudent(struct Student s);. The function should display the details of a student.
View Code
assignment-p-11.c

Write a C program that defines a structure Student containing the attributes rollNumber, name, and marks. Include a user-defined function named displayStudent with the signature void displayStudent(struct Student s);. The function should display the details of a student.

Write a C program that takes multiple integers as command-line arguments and finds the maximum and minimum value among them.
View Code
assignment-p-12_v1.c

Write a C program that takes multiple integers as command-line arguments and finds the maximum and minimum value among them.

Write a C program that takes multiple integers as command-line arguments and finds the maximum and minimum value among them.
View Code
assignment-p-12_v2.c

Write a C program that takes multiple integers as command-line arguments and finds the maximum and minimum value among them.

Write a C program that accepts a string as a command line argument and includes a user- defined function named isPalindrome with the signature int isPalindrome(char str[]);. The function should check if the given string is a palindrome and return 1 if it is, and 0 otherwise.
View Code
assignment-p-13.c

Write a C program that accepts a string as a command line argument and includes a user- defined function named isPalindrome with the signature int isPalindrome(char str[]);. The function should check if the given string is a palindrome and return 1 if it is, and 0 otherwise.

Write a C program that opens its own source code file, reads its contents, and then prints the contents to the console.
View Code
assignment-p-14.c

Write a C program that opens its own source code file, reads its contents, and then prints the contents to the console.

Write a C program that reads a sequence of integers from a file named 'input.txt'. This program should segregate the odd numbers from the even numbers and store the odd numbers in a new file named 'ODDFile.txt' while storing the even numbers in another file named 'EVENFile.txt'
View Code
assignment-p-15.c

Write a C program that reads a sequence of integers from a file named 'input.txt'. This program should segregate the odd numbers from the even numbers and store the odd numbers in a new file named 'ODDFile.txt' while storing the even numbers in another file named 'EVENFile.txt'

Write a program to compute the sum and product of digits of an integer using user defined functions.
View Code
assignment-s-01.c

Write a program to compute the sum and product of digits of an integer using user defined functions.

Write a program to reverse a non-negative integer using a function.
View Code
assignment-s-02.c

Write a program to reverse a non-negative integer using a function.

Write a program to compute the sum of the first n terms of the series using a function: S=1−2+3−4+5−6+…
View Code
assignment-s-03.c

Write a program to compute the sum of the first n terms of the series using a function: S=1−2+3−4+5−6+…

Write a function to check whether a number is prime or not. Use the same function to generate all prime numbers less than 100.
View Code
assignment-s-04.c

Write a function to check whether a number is prime or not. Use the same function to generate all prime numbers less than 100.

Write a function to check whether a given string is a palindrome. Use this function to determine whether an entered string is Palindrome.
View Code
assignment-s-05.c

Write a function to check whether a given string is a palindrome. Use this function to determine whether an entered string is Palindrome.

Write a program using a function to compute and display all factors of a given number.
View Code
assignment-s-06.c

Write a program using a function to compute and display all factors of a given number.

Write a program to swap two numbers using a macro (#define).
View Code
assignment-s-07.c

Write a program to swap two numbers using a macro (#define).

Write a program that counts the number of occurrences of each alphabet (A-Z, a-z) in the text entered using Command-Line Arguments.
View Code
assignment-s-08.c

Write a program that counts the number of occurrences of each alphabet (A-Z, a-z) in the text entered using Command-Line Arguments.

Write a program to swap two numbers using pointers (user-defined function).
View Code
assignment-s-09.c

Write a program to swap two numbers using pointers (user-defined function).

Write a program to swap two numbers using pointers (user-defined function).
View Code
assignment-s-10.c

Write a program to swap two numbers using pointers (user-defined function).

Write a program that takes the radius of a circle as input, passes it to a function that computes area and circumference, and displays results in main().
View Code
assignment-s-11.c

Write a program that takes the radius of a circle as input, passes it to a function that computes area and circumference, and displays results in main().

Write a program to find the sum of n elements entered by the user. Use dynamic memory allocation (malloc() or calloc()).
View Code
assignment-s-12.c

Write a program to find the sum of n elements entered by the user. Use dynamic memory allocation (malloc() or calloc()).

Write a function that reverses the elements of an array in place, using only a single pointer argument, and return void.
View Code
assignment-s-13-1.c

Write a function that reverses the elements of an array in place, using only a single pointer argument, and return void.

Write a function that reverses the elements of an array in place, using only a single pointer argument, and return void.
View Code
assignment-s-13-2.c

Write a function that reverses the elements of an array in place, using only a single pointer argument, and return void.

Write a menu-driven program to perform the following string operations: a. Show address of each character b. Concatenate two strings without using strcat() c. Concatenate two strings using strcat() d. Compare two strings e. Find string length using pointers f. Convert lowercase to uppercase g. Convert uppercase to lowercase h. Count number of vowels i. Reverse the string
View Code
assignment-s-14.c

Write a menu-driven program to perform the following string operations: a. Show address of each character b. Concatenate two strings without using strcat() c. Concatenate two strings using strcat() d. Compare two strings e. Find string length using pointers f. Convert lowercase to uppercase g. Convert uppercase to lowercase h. Count number of vowels i. Reverse the string

Write a program to merge two sorted integer arrays to form a single sorted array.
View Code
assignment-s-15.c

Write a program to merge two sorted integer arrays to form a single sorted array.

Write a program that reads 10 integers into an array (using pointers), and prints the array in ascending and descending order.
View Code
assignment-s-16.c

Write a program that reads 10 integers into an array (using pointers), and prints the array in ascending and descending order.

Write a program to display the Fibonacci series (i) using recursion (ii) using iteration
View Code
assignment-s-17.c

Write a program to display the Fibonacci series (i) using recursion (ii) using iteration

Write a program to calculate the factorial of a number (i) using recursion (ii) using iteration
View Code
assignment-s-18.c

Write a program to calculate the factorial of a number (i) using recursion (ii) using iteration

Write a program to calculate the GCD of two numbers (i) using recursion (ii) without recursion
View Code
assignment-s-19.c

Write a program to calculate the GCD of two numbers (i) using recursion (ii) without recursion

Write a menu-driven program to perform the following matrix operations using 2-D arrays and functions: a. Sum b. Difference c. Product d. Transpose
View Code
assignment-s-20.c

Write a menu-driven program to perform the following matrix operations using 2-D arrays and functions: a. Sum b. Difference c. Product d. Transpose

Write a program to copy the contents of a text file to another file, after removing all white spaces (spaces, tabs, newlines).
View Code
assignment-s-21.c

Write a program to copy the contents of a text file to another file, after removing all white spaces (spaces, tabs, newlines).

Write a program using structures to add two distances in meter-kilometer format.
View Code
assignment-s-22.c

Write a program using structures to add two distances in meter-kilometer format.

Write a program to add two complex numbers using structures.
View Code
assignment-s-23.c

Write a program to add two complex numbers using structures.

Write a program to calculate the difference between two time periods using structures.
View Code
assignment-s-24.c

Write a program to calculate the difference between two time periods using structures.

================= STACK FOR OPERATORS =================
View Code
maheswar01.c

================= STACK FOR OPERATORS =================

A smart home security controller monitors the state of several sensors to decide what action to take. Each second, the system reads data from sensors that can either be active or inactive. Based on the current state of all sensors, the controller must perform exactly one action, such as activating a warning, checking a specific zone, or declaring an intrusion. Write a C program that reads the sensor states as input and prints the corresponding system action. -- Conditions: 1. You must determine exactly one action for every possible combination of sensor states. 2. You are not allowed to use any conditional statements (if, else if, else, or the ternary operator?). 3. You are not allowed to use logical operators. 4. You must use a single switch statement to control the program's behaviour. 5. Loops may only be used for reading input, not for making decisions. 6. The program should handle all possible combinations of the sensors' active/inactive states and print the appropriate response each time. -- Example (for understanding): If all sensors are inactive, the system should remain idle. If some sensors are active, the system should issue warnings or alerts based on the situation. If all sensors are active, the system should declare a confirmed intrusion.
View Code
sudipto1.c

A smart home security controller monitors the state of several sensors to decide what action to take. Each second, the system reads data from sensors that can either be active or inactive. Based on the current state of all sensors, the controller must perform exactly one action, such as activating a warning, checking a specific zone, or declaring an intrusion. Write a C program that reads the sensor states as input and prints the corresponding system action. -- Conditions: 1. You must determine exactly one action for every possible combination of sensor states. 2. You are not allowed to use any conditional statements (if, else if, else, or the ternary operator?). 3. You are not allowed to use logical operators. 4. You must use a single switch statement to control the program's behaviour. 5. Loops may only be used for reading input, not for making decisions. 6. The program should handle all possible combinations of the sensors' active/inactive states and print the appropriate response each time. -- Example (for understanding): If all sensors are inactive, the system should remain idle. If some sensors are active, the system should issue warnings or alerts based on the situation. If all sensors are active, the system should declare a confirmed intrusion.

A smart home security controller monitors the state of several sensors to decide what action to take. Each second, the system reads data from sensors that are either an active or inactive. Based on the current state of all sensors, the controller must perform exactly one action, such as activating a warning, checking a specific zone, or declaring an intrusion. Write a C program that reads the sensor status as input and prints the corresponding system action. Hints: 1. The most determinative action wins for every possible combination of sensor states. 2. You are not allowed to use any conditional statements (if, else if, else, or the ternary operator?). 3. You are not allowed to use logical operators. 4. You must use a single switch statement to control the program's behavior. 5. The program should handle all possible combinations of the sensors' active/inactive states and print the appropriate response each time. 6. All sensors are inactive, the system should remain idle. 7. If some sensors are active, the system should issue warnings or alerts based on the situation. 8. If all sensors are active, the system should declare a confirmed intrusion. Solution: We can solve this problem simply by assigning each case its own distinct integer. There are 2 possibilities for a sensor and therefore there are 2^4 = 16 cases. Using arrays we can assign each case its own index value and print it as per the encoded binary integer.
View Code
sudiptoown01.c

A smart home security controller monitors the state of several sensors to decide what action to take. Each second, the system reads data from sensors that are either an active or inactive. Based on the current state of all sensors, the controller must perform exactly one action, such as activating a warning, checking a specific zone, or declaring an intrusion. Write a C program that reads the sensor status as input and prints the corresponding system action. Hints: 1. The most determinative action wins for every possible combination of sensor states. 2. You are not allowed to use any conditional statements (if, else if, else, or the ternary operator?). 3. You are not allowed to use logical operators. 4. You must use a single switch statement to control the program's behavior. 5. The program should handle all possible combinations of the sensors' active/inactive states and print the appropriate response each time. 6. All sensors are inactive, the system should remain idle. 7. If some sensors are active, the system should issue warnings or alerts based on the situation. 8. If all sensors are active, the system should declare a confirmed intrusion. Solution: We can solve this problem simply by assigning each case its own distinct integer. There are 2 possibilities for a sensor and therefore there are 2^4 = 16 cases. Using arrays we can assign each case its own index value and print it as per the encoded binary integer.

Write a program to compute the sum and product of digits of an integer using user defined functions.
View Code
IP-01.c

Write a program to compute the sum and product of digits of an integer using user defined functions.

Write a program to reverse a non-negative integer using a function.
View Code
IP-02.c

Write a program to reverse a non-negative integer using a function.

Write a program to compute the sum of the first n terms of the series using a function: S=1−2+3−4+5−6+…
View Code
IP-03.c

Write a program to compute the sum of the first n terms of the series using a function: S=1−2+3−4+5−6+…

Write a function to check whether a number is prime or not. Use the same function to generate all prime numbers less than 100.
View Code
IP-04.c

Write a function to check whether a number is prime or not. Use the same function to generate all prime numbers less than 100.

Write a function to check whether a given string is a palindrome. Use this function to determine whether an entered string is Palindrome.
View Code
IP-05.c

Write a function to check whether a given string is a palindrome. Use this function to determine whether an entered string is Palindrome.

Write a program using a function to compute and display all factors of a given number.
View Code
IP-06.c

Write a program using a function to compute and display all factors of a given number.

Write a program to swap two numbers using pointers (user-defined function).
View Code
IP-07.c

Write a program to swap two numbers using pointers (user-defined function).

Write a program that takes the radius of a circle as input, passes it to a function that computes area and circumference, and displays results in main().
View Code
IP-08.c

Write a program that takes the radius of a circle as input, passes it to a function that computes area and circumference, and displays results in main().

Write a program to find the sum of n elements entered by the user. Use dynamic memory allocation (malloc() or calloc()).
View Code
IP-09.c

Write a program to find the sum of n elements entered by the user. Use dynamic memory allocation (malloc() or calloc()).

Write a function that reverses the elements of an array in place, using only a single pointer argument, and return void.
View Code
IP-10.c

Write a function that reverses the elements of an array in place, using only a single pointer argument, and return void.

Write a program to merge two sorted integer arrays to form a single sorted array.
View Code
IP-11.c

Write a program to merge two sorted integer arrays to form a single sorted array.

Write a program that reads 10 integers into an array (using pointers), and prints the array in ascending and descending order.
View Code
IP-12.c

Write a program that reads 10 integers into an array (using pointers), and prints the array in ascending and descending order.

Write a program to display the Fibonacci series (i) using recursion (ii) using iteration
View Code
IP-13.c

Write a program to display the Fibonacci series (i) using recursion (ii) using iteration

Write a program to calculate the factorial of a number (i) using recursion (ii) using iteration
View Code
IP-14.c

Write a program to calculate the factorial of a number (i) using recursion (ii) using iteration

Write a program to calculate the GCD of two numbers (i) using recursion (ii) without recursion
View Code
IP-15.c

Write a program to calculate the GCD of two numbers (i) using recursion (ii) without recursion

Write a C program that includes a user-defined function named isArmstrong with the  signature int isArmstrong(int num);. An Armstrong number is a number that is equal to  the sum of its own digits each raised to the power of the number of digits. For example,  153 is an Armstrong number because 1^3 + 5^3 + 3^3 = 153
View Code
IP-16.c

Write a C program that includes a user-defined function named isArmstrong with the signature int isArmstrong(int num);. An Armstrong number is a number that is equal to the sum of its own digits each raised to the power of the number of digits. For example, 153 is an Armstrong number because 1^3 + 5^3 + 3^3 = 153

Write a C program that includes a user-defined function named isPerfect with the signature  int isPerfect(int num);. A perfect number is a positive integer that is equal to the sum of  its proper divisors, excluding itself. For example, 28 is a perfect number because the sum  of its divisors (1, 2, 4, 7, 14) equals 28.
View Code
IP-17.c

Write a C program that includes a user-defined function named isPerfect with the signature int isPerfect(int num);. A perfect number is a positive integer that is equal to the sum of its proper divisors, excluding itself. For example, 28 is a perfect number because the sum of its divisors (1, 2, 4, 7, 14) equals 28.

Write a C program that includes a user-defined function named findLargest with the signature int findLargest(int arr[], int size);. The function should take an array of integers and its size, and return the largest element in the array.
View Code
IP-18.c

Write a C program that includes a user-defined function named findLargest with the signature int findLargest(int arr[], int size);. The function should take an array of integers and its size, and return the largest element in the array.

Write a C program that includes a user-defined function named binarySearch with the signature int binarySearch(int arr[], int size, int target);. The function should perform a binary search on a sorted array of integers and return the index of the target element if found, and -1 otherwise.
View Code
IP-19.c

Write a C program that includes a user-defined function named binarySearch with the signature int binarySearch(int arr[], int size, int target);. The function should perform a binary search on a sorted array of integers and return the index of the target element if found, and -1 otherwise.

Write a C program that defines an array of integers, and includes a user-defined function named reverseArray with the signature void reverseArray(int arr[], int size);. The function should reverse the elements of the array.
View Code
IP-20.c

Write a C program that defines an array of integers, and includes a user-defined function named reverseArray with the signature void reverseArray(int arr[], int size);. The function should reverse the elements of the array.

here minus 13 because we will remove the massage characters in line 10
View Code
KI001.c

here minus 13 because we will remove the massage characters in line 10

Plan - checking for edge case
View Code
KI002.c

Plan - checking for edge case

Bubble sort (with swap)
View Code
KI003.c

Bubble sort (with swap)

Trying to write code only with emoji
View Code
KI004.c

Trying to write code only with emoji

Temperature of a city in fahrenheit degrees is input through the keyboard. WAP to convert this temperature into Centigrade degrees.
View Code
luc001.c

Temperature of a city in fahrenheit degrees is input through the keyboard. WAP to convert this temperature into Centigrade degrees.

The length and breadth of a rectangle and radius of a circle are input through the keyboard. Write a program to calculate the area and perimeter of the rectangle, and the area and circumference of the circle.
View Code
luc002.c

The length and breadth of a rectangle and radius of a circle are input through the keyboard. Write a program to calculate the area and perimeter of the rectangle, and the area and circumference of the circle.

Paper of size AO has dimensions 1189 mm x 841 mm. Each subsequent size A(n) is defined as A(n-1) cut in half, parallel to its shorter sides. Thus, paper of size A1 would have dimensions 841 mm x 594 mm. Write a program to calculate and print paper sizes A0,� A1,�A2,�...�A8.
View Code
luc003.c

Paper of size AO has dimensions 1189 mm x 841 mm. Each subsequent size A(n) is defined as A(n-1) cut in half, parallel to its shorter sides. Thus, paper of size A1 would have dimensions 841 mm x 594 mm. Write a program to calculate and print paper sizes A0,� A1,�A2,�...�A8.

If a five digit number is input through the keyboard, write a program to calculate the sum of it's digit. (Hint : Use the modulus operator %)
View Code
luc004.c

If a five digit number is input through the keyboard, write a program to calculate the sum of it's digit. (Hint : Use the modulus operator %)

Write a program to recive Cartesian co-ordinates (x, y) of a point and convert them into Polar co-ordinates (r, phi) Hint : r = sqrt (x^2 + y^2) and phi = tan^-1 (y/x)
View Code
luc005.c

Write a program to recive Cartesian co-ordinates (x, y) of a point and convert them into Polar co-ordinates (r, phi) Hint : r = sqrt (x^2 + y^2) and phi = tan^-1 (y/x)

Write a program to receive values of latitude (L1, L2) and longitude (G1, G2), in degrees, of two places on the earth and output the distance (D) between them in nautical miles. The formula for distance in nautical miles is : D = 3963 cos^-1(sin L1 sin L2 + cos L1 cos L2 * cos(G2 - G1))
View Code
luc006.c

Write a program to receive values of latitude (L1, L2) and longitude (G1, G2), in degrees, of two places on the earth and output the distance (D) between them in nautical miles. The formula for distance in nautical miles is : D = 3963 cos^-1(sin L1 sin L2 + cos L1 cos L2 * cos(G2 - G1))

Wind-chill factor is the felt air temperature on exposed skin due to wind. The wind-chill temperature is always lower than the air temperature, and is calculated as per the following formula. wcf = 35.74 + 0.6215t + (0.4275t - 35.75) * v^0.16 Where t is temperature and v is wind velocity. Write a program to receive values of t and v and calcualate wind-chill factor (wcf).
View Code
luc007.c

Wind-chill factor is the felt air temperature on exposed skin due to wind. The wind-chill temperature is always lower than the air temperature, and is calculated as per the following formula. wcf = 35.74 + 0.6215t + (0.4275t - 35.75) * v^0.16 Where t is temperature and v is wind velocity. Write a program to receive values of t and v and calcualate wind-chill factor (wcf).

If value of an angle is input through the keyboard, write a program to print all its trigonometric ratios.
View Code
luc008.c

If value of an angle is input through the keyboard, write a program to print all its trigonometric ratios.

Two numbers are input through the keyboard into two locations C and D. Write a program to interchange the contents of C and D.
View Code
luc009.c

Two numbers are input through the keyboard into two locations C and D. Write a program to interchange the contents of C and D.

A five-digit number is entered through the keyboard. Write a program to obtain the reversed number and to etermine whether the original and reversed numbers are equal or not.
View Code
luc010.c

A five-digit number is entered through the keyboard. Write a program to obtain the reversed number and to etermine whether the original and reversed numbers are equal or not.

If ages of Ram, Shyam and Ajay are input through the keyboard, write a program to determine the youngest of the three.
View Code
luc011.c

If ages of Ram, Shyam and Ajay are input through the keyboard, write a program to determine the youngest of the three.

Write a program to check whether a triangle is valid or not, if three angles of the triangle are entered through the keyboard. A triangle is valid if the sum of all the three angles is equal to 180 degrees.
View Code
luc012.c

Write a program to check whether a triangle is valid or not, if three angles of the triangle are entered through the keyboard. A triangle is valid if the sum of all the three angles is equal to 180 degrees.

Write a program to find the absolute value of a number entered through the keyboard.
View Code
luc013.c

Write a program to find the absolute value of a number entered through the keyboard.

Given the length and breadth of a rectangle, write a program to find whether the area of the rectangle is greater than it's perimeter. For example, the area of the rectangle with length = 5 and breadth = 4 is greater than its perimeter.
View Code
luc014.c

Given the length and breadth of a rectangle, write a program to find whether the area of the rectangle is greater than it's perimeter. For example, the area of the rectangle with length = 5 and breadth = 4 is greater than its perimeter.

Given three points (x1, y1), (x2, y2), and (x3, y3), write a program to check if the three poins fall on one straight line.
View Code
luc015.c

Given three points (x1, y1), (x2, y2), and (x3, y3), write a program to check if the three poins fall on one straight line.

Given the coordiantes (x, y) of center of a circle and its radius, write a program that will determine whether a point lies inside the circle, on the circle or outside the circle. (Hint : Use sqrt() and pow() functions.)
View Code
luc016.c

Given the coordiantes (x, y) of center of a circle and its radius, write a program that will determine whether a point lies inside the circle, on the circle or outside the circle. (Hint : Use sqrt() and pow() functions.)

Given a point (x, y), write a program to find out if it lies on X-axis, Y-axis or origin.
View Code
luc017.c

Given a point (x, y), write a program to find out if it lies on X-axis, Y-axis or origin.

According to Gregorian calender, it was Monday on the date 01/01/01. Write a program to find out what is the day on 1st January of any input year.
View Code
luc018-logic.c

According to Gregorian calender, it was Monday on the date 01/01/01. Write a program to find out what is the day on 1st January of any input year.

According to Gregorian calender, it was Monday on the date 01/01/01. if any year is input through the keyboard write a program to find out what is the day on 1st January of this year.
View Code
luc018.c

According to Gregorian calender, it was Monday on the date 01/01/01. if any year is input through the keyboard write a program to find out what is the day on 1st January of this year.

If the length of three sides of a triangle are entered through the keyboard, write a program to check whether the triangle is an isosceles, an equilateral, a scalene or a right-angled triangle.
View Code
luc019.c

If the length of three sides of a triangle are entered through the keyboard, write a program to check whether the triangle is an isosceles, an equilateral, a scalene or a right-angled triangle.

In digital world colors are specified in Red-Green-Blue (RGB) format, with values of R, G, B varying on an integer scale from 0 to 255. In print publishing the colors are mentioned in Cyan-Magenta-Yellow-Black (CMYK) format, with values of C, M, Y, and K varying on a real scale from 0.0 to 1.0. Write a program that converts RGB color to CMYK color as per the following formulae: White   = Max(Red/255, Green/255, Blue/255) Cyan    = (White-Red/255) / White Magenta = (White-Green/255) / White Yellow  = (White-Blue/255) / White Black   = 1 - White Note that if the RGB values are all 0, then the CMY values are all 0 and the K value is 1.
View Code
luc020.c

In digital world colors are specified in Red-Green-Blue (RGB) format, with values of R, G, B varying on an integer scale from 0 to 255. In print publishing the colors are mentioned in Cyan-Magenta-Yellow-Black (CMYK) format, with values of C, M, Y, and K varying on a real scale from 0.0 to 1.0. Write a program that converts RGB color to CMYK color as per the following formulae: White = Max(Red/255, Green/255, Blue/255) Cyan = (White-Red/255) / White Magenta = (White-Green/255) / White Yellow = (White-Blue/255) / White Black = 1 - White Note that if the RGB values are all 0, then the CMY values are all 0 and the K value is 1.

A certain grade of steel is graded according to the following conditions: (i) Hardness must be greater than 50 (ii) Carbon content must be less than 0.7 (iii) Tensile strength must be greater than 5600  The grades are as follows: Grade is 10 if all three conditions are met Grade is 9 if conditions (i) and (ii) are met Grade is 8 if conditions (ii) and (iii) are met Grade is 7 if conditions (i) and (iii) are met Grade is 6 if only one condition is met Grade is 5 if none of the conditions are met  Write a program, which will require the user to give values of hardness, carbon content and tensile strength of the steel under consideration and output the grade of the steel.
View Code
luc021.c

A certain grade of steel is graded according to the following conditions: (i) Hardness must be greater than 50 (ii) Carbon content must be less than 0.7 (iii) Tensile strength must be greater than 5600 The grades are as follows: Grade is 10 if all three conditions are met Grade is 9 if conditions (i) and (ii) are met Grade is 8 if conditions (ii) and (iii) are met Grade is 7 if conditions (i) and (iii) are met Grade is 6 if only one condition is met Grade is 5 if none of the conditions are met Write a program, which will require the user to give values of hardness, carbon content and tensile strength of the steel under consideration and output the grade of the steel.

The Body Mass Index (BMI) is defined as ratio of  weight of the person (in Kilograms) to square of the height (in meters). Write a program that receives weight and height, calculate the BMI, and reports the BMI catagory as per the following table. BMI Catagory            BMI Starvation              < 15 Anorexic                15.1 to 17.5 Underweight             17.6 to 18.5 Ideal                   18.6 to 24.9 Overweight              25 to 25.9 Obese                   30 to 39.9 Morbidly Obese          >= 40
View Code
luc022.c

The Body Mass Index (BMI) is defined as ratio of weight of the person (in Kilograms) to square of the height (in meters). Write a program that receives weight and height, calculate the BMI, and reports the BMI catagory as per the following table. BMI Catagory BMI Starvation < 15 Anorexic 15.1 to 17.5 Underweight 17.6 to 18.5 Ideal 18.6 to 24.9 Overweight 25 to 25.9 Obese 30 to 39.9 Morbidly Obese >= 40

Using conditional operators determine : (1) Whether the character entered through the keyboard is a lower case alphabet or not. (2) Whether a character entered through the keyboard is a special symbol or not.
View Code
luc023.c

Using conditional operators determine : (1) Whether the character entered through the keyboard is a lower case alphabet or not. (2) Whether a character entered through the keyboard is a special symbol or not.

Write a program using conditional operators to determine whether a year entered through the keyboard is a leap year or not.
View Code
luc024.c

Write a program using conditional operators to determine whether a year entered through the keyboard is a leap year or not.

Write a program to find the greates of the three numbers entered through the keyboard. Use conditional operators.
View Code
luc025.c

Write a program to find the greates of the three numbers entered through the keyboard. Use conditional operators.

Write a program to recieve value of an angle in degreesand check whether sum of squares of sine and cosine of this angle is equal to 1.
View Code
luc026.c

Write a program to recieve value of an angle in degreesand check whether sum of squares of sine and cosine of this angle is equal to 1.

Rewrite the folowing program using conditional operations #include<stdio.h> int main() { float sal; printf(= 25000 && sal <= 40000) printf("Manager\n"); else if(sal >= 15000 && sal < 25000) printf("Accountant\n"); else printf("Clerk\n"); return 0; }" loading="lazy" class="w-full h-auto opacity-90 group-hover:opacity-100 transition-opacity">
View Code
luc027.c

= 25000 && sal <= 40000) printf("Manager\n"); else if(sal >= 15000 && sal < 25000) printf("Accountant\n"); else printf("Clerk\n"); return 0; }">Rewrite the folowing program using conditional operations #include int main() { float sal; printf("Enter the salary"); scanf("%f", &sal); if(sal >= 25000 && sal <= 40000) printf("Manager\n"); else if(sal >= 15000 && sal < 25000) printf("Accountant\n"); else printf("Clerk\n"); return 0; }

Write a program to print all the ASCII values and their equivalent characters using a while loop. The ASCII may vary from 0 to 255.
View Code
luc028.c

Write a program to print all the ASCII values and their equivalent characters using a while loop. The ASCII may vary from 0 to 255.

Write a program to print out all Armstrong numbers between 100 and 500. If sum of cubes of each digit of the number is equal to the number itself, then the number is called an Armstrong number. For example, 153 = (1 * 1 * 1) + (5 * 5 * 5) + (3 * 3 * 3)
View Code
luc029.c

Write a program to print out all Armstrong numbers between 100 and 500. If sum of cubes of each digit of the number is equal to the number itself, then the number is called an Armstrong number. For example, 153 = (1 * 1 * 1) + (5 * 5 * 5) + (3 * 3 * 3)

Write a program for a matchstick game being played between the computer and a user. Your program should ensure that the computer always wins. Rules for the game are as follows : - There are 21 matchsticks. - The computer asks the player to pick 1, 2, 3, or 4 matchsticks. - After the person picks, the computer does its picking. - Whoever is forced to pick up the last matchstick loses the game.
View Code
luc030.c

Write a program for a matchstick game being played between the computer and a user. Your program should ensure that the computer always wins. Rules for the game are as follows : - There are 21 matchsticks. - The computer asks the player to pick 1, 2, 3, or 4 matchsticks. - After the person picks, the computer does its picking. - Whoever is forced to pick up the last matchstick loses the game.

Write a program to enter numbers till the user wants. At the end it  should display the count of positive, negative and zeros entered.
View Code
luc031-logic.c

Write a program to enter numbers till the user wants. At the end it should display the count of positive, negative and zeros entered.

Write a program to enter numbers till the user wants. At the end it should display the count of positive, negative and zeros entered.
View Code
luc031.c

Write a program to enter numbers till the user wants. At the end it should display the count of positive, negative and zeros entered.

Write a program to recieve an integer and find its octal equivalent. (Hint : To obtain octal equivalent of an integer, Divide it continuously by 8 till dividend does not become zero, then write the remainders obtained in reverse derection.)
View Code
luc032.c

Write a program to recieve an integer and find its octal equivalent. (Hint : To obtain octal equivalent of an integer, Divide it continuously by 8 till dividend does not become zero, then write the remainders obtained in reverse derection.)

Write a program to find the range of a set of numbers entered through the keyboard. Range is the difference between the smallest and biggest number in the list.
View Code
luc033.c

Write a program to find the range of a set of numbers entered through the keyboard. Range is the difference between the smallest and biggest number in the list.

Write a program to print the multiplication table of the number entered by the user. The table should get displayed in the following form : 29 * 1 = 29 29 * 2 = 58
View Code
luc034.c

Write a program to print the multiplication table of the number entered by the user. The table should get displayed in the following form : 29 * 1 = 29 29 * 2 = 58

According to a study, the approximate level of intelligence of a person can be calculated using the following formula. i = 2 + (y + 0.5x) write a program that will produce a table of values of i, y and x, where y varies from 1 to 6, and, for each value of y, x varies from 5.5 to 12.5 in steps of 0.5
View Code
luc035.c

According to a study, the approximate level of intelligence of a person can be calculated using the following formula. i = 2 + (y + 0.5x) write a program that will produce a table of values of i, y and x, where y varies from 1 to 6, and, for each value of y, x varies from 5.5 to 12.5 in steps of 0.5

When interest compounds q times per year at an annual rate of r % for n years, the principle p compounds to an amount a as per the following formula a = p (1 + r / q) ^ nq Write a program to read 10 sets of p, r, n & q and calculate the corresponding as'
View Code
luc036.c

When interest compounds q times per year at an annual rate of r % for n years, the principle p compounds to an amount a as per the following formula a = p (1 + r / q) ^ nq Write a program to read 10 sets of p, r, n & q and calculate the corresponding as'

The natural logarithm can be approximated by the following series. (x-1)/x + 1/2 ((x-1)/x)^2 + 1/2 ((x-1)/x)^3 + 1/2 ((x-1)/x)^4 + ... If x is input through the keyboard, write a program to calculate the sum of the first seven terms of this series.
View Code
luc037.c

The natural logarithm can be approximated by the following series. (x-1)/x + 1/2 ((x-1)/x)^2 + 1/2 ((x-1)/x)^3 + 1/2 ((x-1)/x)^4 + ... If x is input through the keyboard, write a program to calculate the sum of the first seven terms of this series.

Write a program to generate all Pythagorean Triplets with slide length less than or equal to 30.
View Code
luc038.c

Write a program to generate all Pythagorean Triplets with slide length less than or equal to 30.

Population of a town today is 100000. The population has increased steadily at the rate of 10% per year for last 10 years. Write a program to determine the population at the end of each year in the last decade.
View Code
luc039.c

Population of a town today is 100000. The population has increased steadily at the rate of 10% per year for last 10 years. Write a program to determine the population at the end of each year in the last decade.

Ramanujan number (1729) is the smallest number that can be expressed as sum of cubes in two different ways - 1729 can be expressed as 1^3 + 12^3 and 9^3 + 10^3. Write a program to print all such numbers up to a reasonable limit.
View Code
luc040-logic.c

Ramanujan number (1729) is the smallest number that can be expressed as sum of cubes in two different ways - 1729 can be expressed as 1^3 + 12^3 and 9^3 + 10^3. Write a program to print all such numbers up to a reasonable limit.

Ramanujan number (1729) is the smallest number that can be expressed as sum of cubes in two different ways - 1729 can be expressed as 1^3 + 12^3 and 9^3 + 10^3. Write a program to print all such numbers up to a reasonable limit.
View Code
luc040.c

Ramanujan number (1729) is the smallest number that can be expressed as sum of cubes in two different ways - 1729 can be expressed as 1^3 + 12^3 and 9^3 + 10^3. Write a program to print all such numbers up to a reasonable limit.

Write a program to print 24 hours of day with suitable suffixes like AM, PM, Noon and Midnight.
View Code
luc041.c

Write a program to print 24 hours of day with suitable suffixes like AM, PM, Noon and Midnight.

Write a program to produce the following output : 1 2       3 4       5       6 7       8       9       10
View Code
luc042.c

Write a program to produce the following output : 1 2 3 4 5 6 7 8 9 10

Write a program to find the grace marks for a student using switch. The user should enter the class obtained by the student and the number of subjects he has failed in. Use the following logic. - If the student gets first class and he fails in more than 3 subjects, he does not get any grace, Otherwise, he gets a grace of 5 marks per subject. - If the student gets second class and he fails in more than 2 subjects, he does not get any grace. Otherwise, he gets a grace of 4 marks per subject. - If the student gets third class and he fails in more than 1 subject, then he does not get any grace. Otherwise, he gets a grace of 5 marks.
View Code
luc043.c

Write a program to find the grace marks for a student using switch. The user should enter the class obtained by the student and the number of subjects he has failed in. Use the following logic. - If the student gets first class and he fails in more than 3 subjects, he does not get any grace, Otherwise, he gets a grace of 5 marks per subject. - If the student gets second class and he fails in more than 2 subjects, he does not get any grace. Otherwise, he gets a grace of 4 marks per subject. - If the student gets third class and he fails in more than 1 subject, then he does not get any grace. Otherwise, he gets a grace of 5 marks.

Any year is entered through the keyboard. Write a function to determine whether the year is aleap year or not.
View Code
luc044.c

Any year is entered through the keyboard. Write a function to determine whether the year is aleap year or not.

A position integer is entered through the keyboard. Write a Function to obtain the prime factors of this number.  For example, prime factors of 24 are 2, 2, 2 and 3, whereas prime  factors of 35 are 5 and 7
View Code
luc045.c

A position integer is entered through the keyboard. Write a Function to obtain the prime factors of this number. For example, prime factors of 24 are 2, 2, 2 and 3, whereas prime factors of 35 are 5 and 7

Given three variables x, y, z, write a function to circularly shift their values to right. In other words, if x = 5, y = 8, z = 10, after circular shift y = 5, z = 8, x = 10. cal the function with variables a, b, c to circularly shift values.
View Code
luc046.c

Given three variables x, y, z, write a function to circularly shift their values to right. In other words, if x = 5, y = 8, z = 10, after circular shift y = 5, z = 8, x = 10. cal the function with variables a, b, c to circularly shift values.

Define a function that receives weight of a commodity in kilograms and returns the equivalent weight in Grams, Tons and pounds. Call this fuction from main() and print the results in main()
View Code
luc047.c

Define a function that receives weight of a commodity in kilograms and returns the equivalent weight in Grams, Tons and pounds. Call this fuction from main() and print the results in main()

Define a function to compute the distance between two points and use it to develop another function that will compute the area of the triangle whose vertices are A(x1, y1), B(x2, y2), and C(x3, y3). Use these functions to develop a function which returns a value 1 if the point (x, y) lines inside the triangle ABC, otherwise returns a value 0. Would you get any advantage if you develop these functions to work on call by reference principle?
View Code
luc048.c

Define a function to compute the distance between two points and use it to develop another function that will compute the area of the triangle whose vertices are A(x1, y1), B(x2, y2), and C(x3, y3). Use these functions to develop a function which returns a value 1 if the point (x, y) lines inside the triangle ABC, otherwise returns a value 0. Would you get any advantage if you develop these functions to work on call by reference principle?

A positive integer is entered through the keyboard, write a function to find the binary equivalent of this number: (1) Without using recursion (2) Using recursion
View Code
luc049.c

A positive integer is entered through the keyboard, write a function to find the binary equivalent of this number: (1) Without using recursion (2) Using recursion

Write a recursive function to obtain the sum of first 25 natural numbers.
View Code
luc050.c

Write a recursive function to obtain the sum of first 25 natural numbers.

Tower of Hanoi: Write a program to print out the sequence in which 4 disks should be moved from peg A to peg C using peg B.
View Code
luc051.c

Tower of Hanoi: Write a program to print out the sequence in which 4 disks should be moved from peg A to peg C using peg B.

If a macro is not getting expanded as per your expectation, how will you find out how is it being expanded by the preprocessor?
View Code
luc052.c

If a macro is not getting expanded as per your expectation, how will you find out how is it being expanded by the preprocessor?

Write macro definitions for: Mean, Absolute value, Uppercase to Lowercase, Biggest of three.
View Code
luc053.c

Write macro definitions for: Mean, Absolute value, Uppercase to Lowercase, Biggest of three.

Use 'interest.h' macros to calculate Simple Interest and Amount.
View Code
luc054.c

Use 'interest.h' macros to calculate Simple Interest and Amount.

Twenty-five numbers are entered from the keyboard into an array. Write a program to find out how many of them are positive, how many are negative, how many are even and how many odd.
View Code
luc055.c

Twenty-five numbers are entered from the keyboard into an array. Write a program to find out how many of them are positive, how many are negative, how many are even and how many odd.

If an array arr contains n elements, then write a program to check if arr[0] = arr[n-1], arr[1] = arr[n-2] and so on.
View Code
luc056.c

If an array arr contains n elements, then write a program to check if arr[0] = arr[n-1], arr[1] = arr[n-2] and so on.

Write a program using pointers to find the smallest number in an array of 25 integers.
View Code
luc057.c

Write a program using pointers to find the smallest number in an array of 25 integers.

Implement the Insertion Sort algorithm shown in Figure 13.3 on a set of 25 numbers.
View Code
luc058.c

Implement the Insertion Sort algorithm shown in Figure 13.3 on a set of 25 numbers.

Write a program which initializes an integer array of 10 elements in main(), passes it to modify(), multiplies each element by 3, and prints the new array in main().
View Code
luc059.c

Write a program which initializes an integer array of 10 elements in main(), passes it to modify(), multiplies each element by 3, and prints the new array in main().

For the following set of sample data, compute the standard deviation and the mean.\nData: -6, -12, 8, 13, 11, 6, 7, 2, -6, -9, -10, 11, 10, 9, 2
View Code
luc060.c

For the following set of sample data, compute the standard deviation and the mean.\nData: -6, -12, 8, 13, 11, 6, 7, 2, -6, -9, -10, 11, 10, 9, 2

The area of a triangle can be computed by the sine law. Given 6 triangular pieces of land (a, b, angle), find their area and determine which is largest.
View Code
luc061.c

The area of a triangle can be computed by the sine law. Given 6 triangular pieces of land (a, b, angle), find their area and determine which is largest.

For the following set of n data points (x, y), write a program to compute the correlation coefficient r.
View Code
luc062.c

For the following set of n data points (x, y), write a program to compute the correlation coefficient r.

The X and Y coordinates of 10 different points are entered through the keyboard. Write a program to find the distance of last point from the first point (sum of distances between consecutive points).
View Code
luc063.c

The X and Y coordinates of 10 different points are entered through the keyboard. Write a program to find the distance of last point from the first point (sum of distances between consecutive points).

Simulate a Dequeue (Double Ended Queue) using an array. Support: retrieve left, retrieve right, insert left, insert right. Use pointers left and right.
View Code
luc064.c

Simulate a Dequeue (Double Ended Queue) using an array. Support: retrieve left, retrieve right, insert left, insert right. Use pointers left and right.

Write a program to find if a square matrix is symmetric.
View Code
luc065.c

Write a program to find if a square matrix is symmetric.

Write a program to add two 6 x 6 matrices.
View Code
luc066.c

Write a program to add two 6 x 6 matrices.

Write a program to multiply any two 3 x 3 matrices.
View Code
luc067.c

Write a program to multiply any two 3 x 3 matrices.

Given an array p[5], write a function to shift it circularly left by two positions. Call this function for a 4 x 5 matrix and get its rows left shifted.
View Code
luc068.c

Given an array p[5], write a function to shift it circularly left by two positions. Call this function for a 4 x 5 matrix and get its rows left shifted.

If the string
View Code
luc069.c

If the string "Alice in wonder land" is fed to the following scanf() statement, what will be the contents of arrays str1, str2, str3 and str4?

Write a program that receives a 10-digit ISBN number, computes the checksum (d1 + 2d2 + 3d3 + ... + 10d10), and reports whether the ISBN number is correct (sum divisible by 11).
View Code
luc070.c

Write a program that receives a 10-digit ISBN number, computes the checksum (d1 + 2d2 + 3d3 + ... + 10d10), and reports whether the ISBN number is correct (sum divisible by 11).

Write a program that receives a 16-digit Credit Card number and checks whether it is valid using the Luhn algorithm variant described.
View Code
luc071.c

Write a program that receives a 16-digit Credit Card number and checks whether it is valid using the Luhn algorithm variant described.

How many bytes in memory would be occupied by the following array of pointers to strings? How many bytes would be required to store the same strings in a two-dimensional character array?
View Code
luc072.c

How many bytes in memory would be occupied by the following array of pointers to strings? How many bytes would be required to store the same strings in a two-dimensional character array?

Write a program to delete all vowels from a sentence. Assume that the sentence is not more than 80 characters long.
View Code
luc073.c

Write a program to delete all vowels from a sentence. Assume that the sentence is not more than 80 characters long.

Write a program that will read a line and delete from it all occurrences of the word 'the'.
View Code
luc074.c

Write a program that will read a line and delete from it all occurrences of the word 'the'.

Write a program that stores a set of names of individuals and abbreviates the first and middle name to their first letter.
View Code
luc075.c

Write a program that stores a set of names of individuals and abbreviates the first and middle name to their first letter.

Write a program to count the number of occurrences of any two vowels in succession in a line of text.
View Code
luc076.c

Write a program to count the number of occurrences of any two vowels in succession in a line of text.

Write a program that receives an integer (less than or equal to nine digits in length) and prints out the number in words.
View Code
luc077.c

Write a program that receives an integer (less than or equal to nine digits in length) and prints out the number in words.

Create a structure 'student' (Roll, Name, Dept, Course, Year). Write functions to print names by join year and print data by roll number.
View Code
luc078.c

Create a structure 'student' (Roll, Name, Dept, Course, Year). Write functions to print names by join year and print data by roll number.

Create a structure for bank customers (Acc no, Name, Balance). Write functions to print low balance customers and handle deposits/withdrawals.
View Code
luc079.c

Create a structure for bank customers (Acc no, Name, Balance). Write functions to print low balance customers and handle deposits/withdrawals.

Automobile engine parts (Serial AA0-FF9, Year, Material, Qty). Retrieve parts between serial numbers BB1 and CC6.
View Code
luc080.c

Automobile engine parts (Serial AA0-FF9, Year, Material, Qty). Retrieve parts between serial numbers BB1 and CC6.

Create structure for Cricketers (Name, Age, Tests, Avg Runs). Sort 20 records by average runs using qsort().
View Code
luc081.c

Create structure for Cricketers (Name, Age, Tests, Avg Runs). Sort 20 records by average runs using qsort().

Structure 'employee' (Code, Name, Date of Joining). Display names of employees with tenure >= 3 years.
View Code
luc082.c

Structure 'employee' (Code, Name, Date of Joining). Display names of employees with tenure >= 3 years.

Library menu-driven program (Add, Display, List by Author, List by Title, Count, List sorted).
View Code
luc083.c

Library menu-driven program (Add, Display, List by Author, List by Title, Count, List sorted).

Define a function that compares two given dates. Return 0 if equal, otherwise return 1.
View Code
luc084.c

Define a function that compares two given dates. Return 0 if equal, otherwise return 1.

Suppose a file contains student records (Name, Age). Write a program to read these records and display them in sorted order by name.
View Code
luc085.c

Suppose a file contains student records (Name, Age). Write a program to read these records and display them in sorted order by name.

Write a program to copy contents of one file to another. While doing so replace all lowercase characters to their equivalent uppercase characters.
View Code
luc086.c

Write a program to copy contents of one file to another. While doing so replace all lowercase characters to their equivalent uppercase characters.

Write a program that merges lines alternately from two files and writes the results to a new file. Handle remaining lines if file sizes differ.
View Code
luc087.c

Write a program that merges lines alternately from two files and writes the results to a new file. Handle remaining lines if file sizes differ.

Write a program to encrypt/decrypt a file using: (1) Offset cipher (2) Substitution cipher.
View Code
luc088.c

Write a program to encrypt/decrypt a file using: (1) Offset cipher (2) Substitution cipher.

Update 'CUSTOMER.DAT' balance using 'TRANSACTIONS.DAT' (Deposit/Withdrawal). Ensure balance doesn't fall below Rs. 100 on withdrawal.
View Code
luc089.c

Update 'CUSTOMER.DAT' balance using 'TRANSACTIONS.DAT' (Deposit/Withdrawal). Ensure balance doesn't fall below Rs. 100 on withdrawal.

Read employee records (code, name, date, salary), sort them by Date of Joining, and write to a target file.
View Code
luc090.c

Read employee records (code, name, date, salary), sort them by Date of Joining, and write to a target file.

Read 'blood donors' file (Name, Address, Age, Blood Type). Print donors with Age < 25 and Blood Type 2.
View Code
luc091.c

Read 'blood donors' file (Name, Address, Age, Blood Type). Print donors with Age < 25 and Blood Type 2.

Write a program to store names in a file. Display the n-th name in the list, where n is read from the keyboard.
View Code
luc092.c

Write a program to store names in a file. Display the n-th name in the list, where n is read from the keyboard.

Update Master file (Roll, Name) using Transaction file (Roll, Code Add/Delete). Both files are sorted by Roll.
View Code
luc093.c

Update Master file (Roll, Name) using Transaction file (Roll, Code Add/Delete). Both files are sorted by Roll.

Read a text file, delete the words 'a', 'the', 'an' and replace each with a blank space. Write to new file.
View Code
luc094.c

Read a text file, delete the words 'a', 'the', 'an' and replace each with a blank space. Write to new file.

Write a program that can read a file and display its contents. The file name should be supplied as a command-line argument.
View Code
luc095.c

Write a program that can read a file and display its contents. The file name should be supplied as a command-line argument.

Write a program that can copy the contents of one file to another. The source and target filenames should be supplied as command-line arguments.
View Code
luc096.c

Write a program that can copy the contents of one file to another. The source and target filenames should be supplied as command-line arguments.

Write a program using command-line arguments to search for a word in a file and replace it with the specified word.\nUsage: change <old word> <new word> <filename>
View Code
luc097.c

Write a program using command-line arguments to search for a word in a file and replace it with the specified word.\nUsage: change

Write a calculator utility using command line arguments.\nUsage: calc <switch> <n> <m>\nwhere switch is arithmetic operator or comparison operator.
View Code
luc098.c

Write a calculator utility using command line arguments.\nUsage: calc \nwhere switch is arithmetic operator or comparison operator.

Read an integer 'game' representing sports won by a college. Determine if it won the 'Champion of Champions' trophy (>5 games) and list games won.
View Code
luc099.c

Read an integer 'game' representing sports won by a college. Determine if it won the 'Champion of Champions' trophy (>5 games) and list games won.

Determine if an animal is Carnivore/Herbivore and its type (Canine, Feline, Cetacean, Marsupial) based on bits in an integer.
View Code
luc100.c

Determine if an animal is Carnivore/Herbivore and its type (Canine, Feline, Cetacean, Marsupial) based on bits in an integer.

Decode student information (Year, Stream, Room No) packed into an integer array.
View Code
luc101.c

Decode student information (Year, Stream, Room No) packed into an integer array.

What will be the output of the provided program segment involving bitwise operators?
View Code
luc102.c

What will be the output of the provided program segment involving bitwise operators?

What is the hexadecimal equivalent of the following binary numbers?
View Code
luc103.c

What is the hexadecimal equivalent of the following binary numbers?

Rewrite expressions using bitwise compound assignment operators.
View Code
luc104.c

Rewrite expressions using bitwise compound assignment operators.

Write a function checkbits(x, p, n) which returns true if all 'n' bits starting from position 'p' are turned on.
View Code
luc105.c

Write a function checkbits(x, p, n) which returns true if all 'n' bits starting from position 'p' are turned on.

Write a program to scan an 8-bit number and check whether its 3rd, 6th and 7th bit is on.
View Code
luc106.c

Write a program to scan an 8-bit number and check whether its 3rd, 6th and 7th bit is on.

Receive an unsigned 16-bit integer and exchange the contents of its 2 bytes using bitwise operators.
View Code
luc107.c

Receive an unsigned 16-bit integer and exchange the contents of its 2 bytes using bitwise operators.

Receive an 8-bit number and exchange its higher 4 bits with lower 4 bits.
View Code
luc108.c

Receive an 8-bit number and exchange its higher 4 bits with lower 4 bits.

Receive an 8-bit number and set its odd bits to 1.
View Code
luc109.c

Receive an 8-bit number and set its odd bits to 1.

Receive an 8-bit number. Check if 3rd and 5th bits are ON. If yes, put them OFF.
View Code
luc110.c

Receive an 8-bit number. Check if 3rd and 5th bits are ON. If yes, put them OFF.

Receive an 8-bit number. Check if 3rd and 5th bits are OFF. If yes, put them ON.
View Code
luc111.c

Receive an 8-bit number. Check if 3rd and 5th bits are OFF. If yes, put them ON.

Rewrite the showbits() function using the _BV macro.
View Code
luc112.c

Rewrite the showbits() function using the _BV macro.

Store date in a structure using bit fields (day: 5 bits, month: 4 bits, year: 12 bits). Read joining dates of 10 employees and display them sorted by year.
View Code
luc113.c

Store date in a structure using bit fields (day: 5 bits, month: 4 bits, year: 12 bits). Read joining dates of 10 employees and display them sorted by year.

Store insurance policy holder info (gender, minor/major, policy name, duration) using bit-fields.
View Code
luc114.c

Store insurance policy holder info (gender, minor/major, policy name, duration) using bit-fields.

Obtain MD5 checksum of the following strings and check whether they are same:
View Code
luc115.c

Obtain MD5 checksum of the following strings and check whether they are same: "Six slippery snails slid slowly seaward." "Six silppery snails slid slowly seaward."

Compile any C program into a .EXE or a .out file. Obtain SHA256 checksum of the file.
View Code
luc116.c

Compile any C program into a .EXE or a .out file. Obtain SHA256 checksum of the file.

Write a program to convert a given text into an audio file using OpenAI Audio API (TTS).
View Code
luc117.c

Write a program to convert a given text into an audio file using OpenAI Audio API (TTS).

Write a program to generate 4 images of birds flying in the sky with a computer's mouse in their beak using OpenAI Image API.
View Code
luc118.c

Write a program to generate 4 images of birds flying in the sky with a computer's mouse in their beak using OpenAI Image API.

Write a program to analyse a given sentence to detect the mood of the sentence using OpenAI Chat Completion API.
View Code
luc119.c

Write a program to analyse a given sentence to detect the mood of the sentence using OpenAI Chat Completion API.

Consider a currency system in which there are notes of six denominations, namely, Rs. 1, Rs. 2, rs. 5, Rs. 10, Rs. 50, Rs. 100. If a sum of Rs. N is entered through the keyboard, Write a program to compute the smallest number of notes that will combine to give Rs. N.
View Code
lucproblem001.c

Consider a currency system in which there are notes of six denominations, namely, Rs. 1, Rs. 2, rs. 5, Rs. 10, Rs. 50, Rs. 100. If a sum of Rs. N is entered through the keyboard, Write a program to compute the smallest number of notes that will combine to give Rs. N.

A year is entered through the keyboard, write a program to determine whether the year is leap or not. Use the logical operators && and || .
View Code
lucproblem002.c

A year is entered through the keyboard, write a program to determine whether the year is leap or not. Use the logical operators && and || .

If a character is entered through the keyboard, Write a program to determine whether the character is a capital letter, a small case letter, a digit or a speacial symbol. The following table shows the range of ASCII values for various characters : Characters              ASCII Values A - Z                   65 - 90 a - z                   97 - 122 0 - 9                   48 - 57 special symbols         0 - 47, 58 - 64, 91 - 96, 123 - 127
View Code
lucproblem003.c

If a character is entered through the keyboard, Write a program to determine whether the character is a capital letter, a small case letter, a digit or a speacial symbol. The following table shows the range of ASCII values for various characters : Characters ASCII Values A - Z 65 - 90 a - z 97 - 122 0 - 9 48 - 57 special symbols 0 - 47, 58 - 64, 91 - 96, 123 - 127

If the lengths of three sides of a triangle are entered through the keyboard, write a program to check whether the triangle is valid or not. The triangle is valid if the sum of two sides is greater that the largest of the three sides.
View Code
lucproblem004.c

If the lengths of three sides of a triangle are entered through the keyboard, write a program to check whether the triangle is valid or not. The triangle is valid if the sum of two sides is greater that the largest of the three sides.

Write a program to calculate overtime pay of 10 employees. Overtime is paid at the rate of Rs. 120.00 per hour for every hour worked above 40 hours. Assume that employees do not work for fractional part of an hour.
View Code
lucproblem005.c

Write a program to calculate overtime pay of 10 employees. Overtime is paid at the rate of Rs. 120.00 per hour for every hour worked above 40 hours. Assume that employees do not work for fractional part of an hour.

Write a program to find the factorial value of any number entered through the keyboard.
View Code
lucproblem006.c

Write a program to find the factorial value of any number entered through the keyboard.

Two numbers are entered through the keyboard. Write a program to find the value of one number raised to the power of another
View Code
lucproblem007.c

Two numbers are entered through the keyboard. Write a program to find the value of one number raised to the power of another

Write a problem to print all the prime numbers from 1 to 300.
View Code
lucproblem008.c

Write a problem to print all the prime numbers from 1 to 300.

Write a program to add first seven terms of the following series using a for loop. 1 / 1! + 2 / 2! + 3 / 3! + ...
View Code
lucproblem009.c

Write a program to add first seven terms of the following series using a for loop. 1 / 1! + 2 / 2! + 3 / 3! + ...

Write a program to generate all combinations (permutations) of 1, 2 and 3 from 1-digit numbers up to 4-digit numbers using a main loop to control the number of digits (1 to 3333).
View Code
lucproblem010-complex.c

Write a program to generate all combinations (permutations) of 1, 2 and 3 from 1-digit numbers up to 4-digit numbers using a main loop to control the number of digits (1 to 3333).

Write a program to generate all combination of 1, 2 and 3 using for loop.
View Code
lucproblem010.c

Write a program to generate all combination of 1, 2 and 3 using for loop.

Write a menu driven program which has following options : 1. Factorial of a number 2. Prime or not 3. Odd or even 4. Exit Once a menu item is selected the appropriate action should be taken and once this action is finished, the menu should reappear. Unless the user selects the 'Exit' option the program should continue work.
View Code
lucproblem011.c

Write a menu driven program which has following options : 1. Factorial of a number 2. Prime or not 3. Odd or even 4. Exit Once a menu item is selected the appropriate action should be taken and once this action is finished, the menu should reappear. Unless the user selects the 'Exit' option the program should continue work.

Write a Function power(a, b), to calculate the value of a raised to b
View Code
lucproblem012.c

Write a Function power(a, b), to calculate the value of a raised to b

Define a function to convert any given year into its Roman equivalent. Use these roman equivalent for decimal numbers : 1 - I, 5 - V, 10 - X, 50 - L, 100 - C, 500 - D, 1000 - M
View Code
lucproblem013.c

Define a function to convert any given year into its Roman equivalent. Use these roman equivalent for decimal numbers : 1 - I, 5 - V, 10 - X, 50 - L, 100 - C, 500 - D, 1000 - M

Write a function that receives integers and returns the sum, average and standard deviation of these numbers. Call this function from main() and print the result in main()
View Code
lucproblem014-short.c

Write a function that receives integers and returns the sum, average and standard deviation of these numbers. Call this function from main() and print the result in main()

Write a function that receives integers and returns the sum, average and standard deviation of these numbers. Call this function from main() and print the result in main()
View Code
lucproblem014.c

Write a function that receives integers and returns the sum, average and standard deviation of these numbers. Call this function from main() and print the result in main()

Write a program that defines a function that calculates power of one number reaised to another and factorial value of a number in one cell.
View Code
lucproblem015.c

Write a program that defines a function that calculates power of one number reaised to another and factorial value of a number in one cell.

Figure 9.4 shows three memory locations and values stored in them. Write a program to declare  variables that implement the relationship shown. How will you print the values and addresses shown in the figure? On which machine the program should be executed to get such addresses?  Figure 9.4: value: 3.14, memory_address: 7fff9489c79c value: 7fff9489c7a0, memory_address: 7fff4fd134b8 value: 7fff9489c79c,  memory_address: 7fff9489c7a0
View Code
lucproblem016.c

Figure 9.4 shows three memory locations and values stored in them. Write a program to declare variables that implement the relationship shown. How will you print the values and addresses shown in the figure? On which machine the program should be executed to get such addresses? Figure 9.4: value: 3.14, memory_address: 7fff9489c79c value: 7fff9489c7a0, memory_address: 7fff4fd134b8 value: 7fff9489c79c, memory_address: 7fff9489c7a0

Question 1: Write a program to compute the sum and product of digits of an integer using user-defined functions.
View Code
pc-ip-01.c

Question 1: Write a program to compute the sum and product of digits of an integer using user-defined functions.

Question 2: Write a program to reverse a non-negative integer using a function.
View Code
pc-ip-02.c

Question 2: Write a program to reverse a non-negative integer using a function.

Question 3: Write a program to compute the sum of the first n terms of the series using a function: S=1-2+3-4+5-6+...
View Code
pc-ip-03.c

Question 3: Write a program to compute the sum of the first n terms of the series using a function: S=1-2+3-4+5-6+...

Question 4: Write a function to check whether a number is prime or not. Use the same function to generate all prime numbers less than 100.
View Code
pc-ip-04.c

Question 4: Write a function to check whether a number is prime or not. Use the same function to generate all prime numbers less than 100.

Question 5: Write a function to check whether a given string is a palindrome. Use this function to determine whether an entered string is Palindrome.
View Code
pc-ip-05.c

Question 5: Write a function to check whether a given string is a palindrome. Use this function to determine whether an entered string is Palindrome.

Question 6: Write a program using a function to compute and display all factors of a given number.
View Code
pc-ip-06.c

Question 6: Write a program using a function to compute and display all factors of a given number.

Question 7: Write a program to swap two numbers using pointers using user-defined function.
View Code
pc-ip-07.c

Question 7: Write a program to swap two numbers using pointers using user-defined function.

Question 8: Write a program that takes the radius of a circle as input, passes it to a function that computes area and circumference, and displays results in main().
View Code
pc-ip-08.c

Question 8: Write a program that takes the radius of a circle as input, passes it to a function that computes area and circumference, and displays results in main().

Question 9: Write a program to find the sum of n elements entered by the user. Use dynamic memory allocation (malloc() or calloc()).
View Code
pc-ip-09.c

Question 9: Write a program to find the sum of n elements entered by the user. Use dynamic memory allocation (malloc() or calloc()).

Question 10: Write a function that reverses each elements of an array in place, using only a single pointer argument, and return void.
View Code
pc-ip-10.c

Question 10: Write a function that reverses each elements of an array in place, using only a single pointer argument, and return void.

Question 11: Write a program to merge two sorted integer arrays to form a single sorted array.
View Code
pc-ip-11.c

Question 11: Write a program to merge two sorted integer arrays to form a single sorted array.

Question 12: Write a program that reads 10 integers into an array (using pointers), and prints the array in ascending and descending order.
View Code
pc-ip-12.c

Question 12: Write a program that reads 10 integers into an array (using pointers), and prints the array in ascending and descending order.

Question 13: Write a program to display the Fibonacci series using recursive function and iterative function.
View Code
pc-ip-13.c

Question 13: Write a program to display the Fibonacci series using recursive function and iterative function.

Question 14: Write a program to calculate the factorial of a number using recursive and iterative function.
View Code
pc-ip-14.c

Question 14: Write a program to calculate the factorial of a number using recursive and iterative function.

Question 15: Write a program to calculate the GCD of two numbers using recursive and iterative function.
View Code
pc-ip-15.c

Question 15: Write a program to calculate the GCD of two numbers using recursive and iterative function.

Question 16: Write a C program that includes a user-defined function named isArmstrong with the signature int isArmstrong(int num);.
View Code
pc-ip-16.c

Question 16: Write a C program that includes a user-defined function named isArmstrong with the signature int isArmstrong(int num);.

Question 17: Write a C program that includes a user-defined function named isPerfect with the signature int isPerfect(int num);.
View Code
pc-ip-17.c

Question 17: Write a C program that includes a user-defined function named isPerfect with the signature int isPerfect(int num);.

Question 18: Write a C program that includes a user-defined function named findLargest with the signature int findLargest(int arr[], int size);.
View Code
pc-ip-18.c

Question 18: Write a C program that includes a user-defined function named findLargest with the signature int findLargest(int arr[], int size);.

Question 19: Write a C program that includes a user-defined function named binarySearch with the signature int binarySearch(int arr[], int size, int target);.
View Code
pc-ip-19.c

Question 19: Write a C program that includes a user-defined function named binarySearch with the signature int binarySearch(int arr[], int size, int target);.

Question 20: Write a C program that defines an array of integers, and includes a user-defined function named reverseArray with the signature void reverseArray(int arr[], int size);.
View Code
pc-ip-20.c

Question 20: Write a C program that defines an array of integers, and includes a user-defined function named reverseArray with the signature void reverseArray(int arr[], int size);.

Pattern : 1 1   2 1   2   3 1   2   3   4 1   2   3   4   5 for n = 5
View Code
pc001.c

Pattern : 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 for n = 5

Pattern : 1   2   3   4   5 6   7   8   9 10  11  12 13  14 15 for n = 5
View Code
pc002.c

Pattern : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 for n = 5

Pattern : 1 2   4 3   6   9 4   8   12  16 5   10  15  20  25 for n = 5
View Code
pc003.c

Pattern : 1 2 4 3 6 9 4 8 12 16 5 10 15 20 25 for n = 5

Pattern : 5   4   3   2   1 4   3   2   1 3   2   1 2   1 1 for n = 5
View Code
pc004.c

Pattern : 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1 for n = 5

Pattern : 1 1   2 3   5   8 13  21  34  55 89  144 233 377 610 for n = 5
View Code
pc005.c

Pattern : 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 for n = 5

Prime number check
View Code
pc006.c

Prime number check

Armstrong number check only for three digit
View Code
pc007.c

Armstrong number check only for three digit

Factorial upto N
View Code
pc008.c

Factorial upto N

Sum of digit
View Code
pc009.c

Sum of digit

Reverse a number
View Code
pc010.c

Reverse a number

Write a C program that takes two positive integers, L (Lower Bound) and U (Upper Bound), as input from the user. The program must find and print the count of all numbers between L and U (inclusive) that are also a Palindrome Number.
View Code
pc011.c

Write a C program that takes two positive integers, L (Lower Bound) and U (Upper Bound), as input from the user. The program must find and print the count of all numbers between L and U (inclusive) that are also a Palindrome Number.

Write a C function that receives a string (character array) and uses pointers to count and return the total number of vowels and consonants in that string.
View Code
pc012.c

Write a C function that receives a string (character array) and uses pointers to count and return the total number of vowels and consonants in that string.

WAP to calculate area and perimeter of a rectangle  by accepting length and breadth as input.
View Code
APC-PRAC-001.c

WAP to calculate area and perimeter of a rectangle by accepting length and breadth as input.

WAP to calculate area of a circle using math library method. Take radius of the circle as input.
View Code
APC-PRAC-002.c

WAP to calculate area of a circle using math library method. Take radius of the circle as input.

WAP to accept  diagonal of a square and calculate area, parimeter
View Code
APC-PRAC-003.c

WAP to accept diagonal of a square and calculate area, parimeter

WAP to calculate and display radius of a circle by taking the area as input.
View Code
APC-PRAC-004.c

WAP to calculate and display radius of a circle by taking the area as input.

WAP a program that accept number of days as input and represent it as years, months and days.
View Code
APC-PRAC-005.c

WAP a program that accept number of days as input and represent it as years, months and days.

WAP that accept seconds as input and represent it an hours, minutes and seconds.
View Code
APC-PRAC-006.c

WAP that accept seconds as input and represent it an hours, minutes and seconds.

WAP that accept basic salary of an employee and display gross salary, net salary generated by below formula. DA = 25% of the basic salary. HRA = 12.5% of the basic salary. PF = 10% of the basic salary. gross salary = basic salary + da + hra net salary = gross salary - pf
View Code
APC-PRAC-007.c

WAP that accept basic salary of an employee and display gross salary, net salary generated by below formula. DA = 25% of the basic salary. HRA = 12.5% of the basic salary. PF = 10% of the basic salary. gross salary = basic salary + da + hra net salary = gross salary - pf

WAP to multiply and divide a number by 4 without using multiplication and division operator.
View Code
APC-PRAC-008.c

WAP to multiply and divide a number by 4 without using multiplication and division operator.

WAP to swap two integer variable without using Third variable.
View Code
APC-PRAC-009.c

WAP to swap two integer variable without using Third variable.

WAP to calculate and display the valve of the given expression : (1/a^3) + (1/(b+2)^3) + (1/(c^4 + root(2))) take a, b, c as input.
View Code
APC-PRAC-010.c

WAP to calculate and display the valve of the given expression : (1/a^3) + (1/(b+2)^3) + (1/(c^4 + root(2))) take a, b, c as input.

Write a program to input positive number and check whether the number is perfect square or not. If the number is negetive then display appropriate message
View Code
APC-PRAC-011.c

Write a program to input positive number and check whether the number is perfect square or not. If the number is negetive then display appropriate message

Write a program to input three integer and find out second largest
View Code
APC-PRAC-012.c

Write a program to input three integer and find out second largest

Write a program to input sum(p), rate of interest(r), time(t) and type of interest ('s' for simple interes, 'c' for compound interest), then calculate and display the earned interest
View Code
APC-PRAC-013.c

Write a program to input sum(p), rate of interest(r), time(t) and type of interest ('s' for simple interes, 'c' for compound interest), then calculate and display the earned interest

Write a program to calculate and display the maturity amount taking the sum and number of days as input. No. of Days     Rate of Interest ===========     ================ <= 180          5.57 % 181 - 364       7.75 % 365 - 500       9.25 % > 500           9.15 %
View Code
APC-PRAC-014.c

Write a program to calculate and display the maturity amount taking the sum and number of days as input. No. of Days Rate of Interest =========== ================ <= 180 5.57 % 181 - 364 7.75 % 365 - 500 9.25 % > 500 9.15 %

Write a program to display all numbers between lb (lower bound) and up (upper bound) which ends with digit 7 or divisible by 7.
View Code
APC-PRAC-015.c

Write a program to display all numbers between lb (lower bound) and up (upper bound) which ends with digit 7 or divisible by 7.

Write a program to check palindrome number.
View Code
APC-PRAC-016.c

Write a program to check palindrome number.

Write a program to check perfect number.
View Code
APC-PRAC-017.c

Write a program to check perfect number.

Write a program to check Automorphic Number.
View Code
APC-PRAC-018.c

Write a program to check Automorphic Number.

Write a program to find hcf of two numbers
View Code
APC-PRAC-019.c

Write a program to find hcf of two numbers

Write a program to check if two number is co-prime or not
View Code
APC-PRAC-020.c

Write a program to check if two number is co-prime or not

Write a program to check special number (sum of digit + product of digit = original number)
View Code
APC-PRAC-021.c

Write a program to check special number (sum of digit + product of digit = original number)

Write a program to accept a number and check whether the number is twisted prime or not
View Code
APC-PRAC-022.c

Write a program to accept a number and check whether the number is twisted prime or not

Pattern : (a) 1, -3, 5, -7, 9, -11, ... upto n times (b) 0, 3, 8, 15, ... upto n times
View Code
APC-PRAC-023.c

Pattern : (a) 1, -3, 5, -7, 9, -11, ... upto n times (b) 0, 3, 8, 15, ... upto n times

Pattern: 	1 	2	1 	3	2	1 	4	3	2	1 	5	4	3	2	1
View Code
APC-PRAC-024.c

Pattern: 1 2 1 3 2 1 4 3 2 1 5 4 3 2 1

Pattern: 	5    4    3    2    1 	5    4    3    2 	5    4    3 	5    4 	5
View Code
APC-PRAC-025.c

Pattern: 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5

Pattern: 	5 	5    4 	5    4    3 	5    4    3    2 	5    4    3    2    1
View Code
APC-PRAC-026.c

Pattern: 5 5 4 5 4 3 5 4 3 2 5 4 3 2 1

Pattern: 	1    2    3    4    5 	2    3    4    5 	3    4    5 	4    5 	5
View Code
APC-PRAC-027.c

Pattern: 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5

Pattern: 	1 	2       3 	4       5       6 	7       8       9       10 	11      12      13      14      15
View Code
APC-PRAC-028.c

Pattern: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Pattern: 	1 	1   0 	1   0   1 	1   0   1   0 	1   0   1   0   1
View Code
APC-PRAC-029.c

Pattern: 1 1 0 1 0 1 1 0 1 0 1 0 1 0 1

Pattern: 	# 	@   @ 	#   #   # 	@   @   @   @ 	#   #   #   #   #
View Code
APC-PRAC-030.c

Pattern: # @ @ # # # @ @ @ @ # # # # #

Pattern: 	1       2       3       4       5 	6       7       8       9 	10      11      12 	13      14 	15
View Code
APC-PRAC-031.c

Pattern: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Pattern: 	A 	B       B 	C       C       C 	D       D       D       D 	E       E       E       E       E
View Code
APC-PRAC-032.c

Pattern: A B B C C C D D D D E E E E E

Print the factorial of the digits off a number
View Code
APC-PRAC-033.c

Print the factorial of the digits off a number

Take a Range as input from user and print the prime number between it.
View Code
APC-PRAC-034.c

Take a Range as input from user and print the prime number between it.

Print all the 3 and 4 digit palindrome number.
View Code
APC-PRAC-035.c

Print all the 3 and 4 digit palindrome number.

Check krishnamurty number.
View Code
APC-PRAC-036.c

Check krishnamurty number.

Show all the armstrong number between a range.
View Code
APC-PRAC-037.c

Show all the armstrong number between a range.

Print all combinations of two two-digit numbers such that the sum of digits of both numbers is equal. Example: 23 and 41 → (2+3) = 5, (4+1) = 5.
View Code
APC-PRAC-038.c

Print all combinations of two two-digit numbers such that the sum of digits of both numbers is equal. Example: 23 and 41 → (2+3) = 5, (4+1) = 5.

Write a C program to print all unique combinations of three numbers (a, b, c) such that: 1 ≤ a, b, c ≤ 30 and a² + b² = c² (Pythagorean triplets)
View Code
APC-PRAC-039.c

Write a C program to print all unique combinations of three numbers (a, b, c) such that: 1 ≤ a, b, c ≤ 30 and a² + b² = c² (Pythagorean triplets)

Write a C program to count how many numbers between 100 and 999 have all distinct digits (e.g., 123, 709, 981).
View Code
APC-PRAC-040.c

Write a C program to count how many numbers between 100 and 999 have all distinct digits (e.g., 123, 709, 981).

Write a C program to find and print all twin prime pairs between 1 and n using nested loops. (Twin primes are prime numbers having a difference of 2, like 11 and 13)
View Code
APC-PRAC-041.c

Write a C program to find and print all twin prime pairs between 1 and n using nested loops. (Twin primes are prime numbers having a difference of 2, like 11 and 13)

Write a function to check whether a given string is a palindrome. Use this function to determine whether an entered string is Palindrome.
View Code
APC-PRAC-042.c

Write a function to check whether a given string is a palindrome. Use this function to determine whether an entered string is Palindrome.

APC-S-001.c
View Code
APC-S-001.c

APC-S-001.c

APC-S-002.c
View Code
APC-S-002.c

APC-S-002.c

APC-S-003.c
View Code
APC-S-003.c

APC-S-003.c

Program to print first 10 natural numbers using while loop.
View Code
APC-S-004.c

Program to print first 10 natural numbers using while loop.

Write to reverse a number.
View Code
APC-S-005.c

Write to reverse a number.

Write a program to print first 10 multiple of 5
View Code
APC-S-006.c

Write a program to print first 10 multiple of 5

Write a program the sum of first 10 natural numbers.
View Code
APC-S-007.c

Write a program the sum of first 10 natural numbers.

Write a program to print the sum of two matrix as input given by the user.
View Code
APC-S-008.c

Write a program to print the sum of two matrix as input given by the user.

Write a program to find the upper and lower triangular matrix.
View Code
APC-S-009.c

Write a program to find the upper and lower triangular matrix.

Write a program to input a new element at a specific position of an array. a[] = {4, 5, 2, 10, 6, 9, 8}, newItem = 7, position = 3
View Code
APC-S-010.c

Write a program to input a new element at a specific position of an array. a[] = {4, 5, 2, 10, 6, 9, 8}, newItem = 7, position = 3

Linear search
View Code
APC-S-011.c

Linear search

Write a program to check if a matrix is a sparx matrix.
View Code
APC-S-012.c

Write a program to check if a matrix is a sparx matrix.

Write a fuction to calculate the average of an array
View Code
APC-S-013.c

Write a fuction to calculate the average of an array

Write a program to store roll no, name and marks of 5 students then print it. use structure
View Code
APC-S-014.c

Write a program to store roll no, name and marks of 5 students then print it. use structure

APC-SPS-001.c
View Code
APC-SPS-001.c

APC-SPS-001.c

WAP to swap two integers. Display both numbers before and after swap
View Code
APC-SPS-002.c

WAP to swap two integers. Display both numbers before and after swap

Bitwise AND '&'
View Code
APC-SPS-003.c

Bitwise AND '&'

APC-SPS-004.c
View Code
APC-SPS-004.c

APC-SPS-004.c

Bitwise OR '|'
View Code
APC-SPS-005.c

Bitwise OR '|'

Bitwise NOT '~'
View Code
APC-SPS-006.c

Bitwise NOT '~'

WAP to check a number is even or odd using bitwise operator
View Code
APC-SPS-007.c

WAP to check a number is even or odd using bitwise operator

WAP to calculate area of circle by accepting radius as input
View Code
APC-SPS-008.c

WAP to calculate area of circle by accepting radius as input

P001.c
View Code
P001.c

P001.c

P002.c
View Code
P002.c

P002.c

P003.c
View Code
P003.c

P003.c

WAP to find and display the value of given expression : ((x+3)/4) - ((2x+4)/3) taking the value of x = 5
View Code
P004.c

WAP to find and display the value of given expression : ((x+3)/4) - ((2x+4)/3) taking the value of x = 5

A person is paid Rs. 455 for each day he works and fined Rs. 150 for each day he remains absent. WAP to calculate his monthly income taking the number of days present as input.
View Code
P005.c

A person is paid Rs. 455 for each day he works and fined Rs. 150 for each day he remains absent. WAP to calculate his monthly income taking the number of days present as input.

The normal temperature of human body is 98.6 Degree Fahrenheit. WAP to convert the temperature to Degree Celcius and display the output.
View Code
P006.c

The normal temperature of human body is 98.6 Degree Fahrenheit. WAP to convert the temperature to Degree Celcius and display the output.

A shopkeeper offers 10% discount on printed price of a digital camera. However a customer has to pay 6% GST on the remaining amount. WAP to calculate and display the amount to paid by the customer, taking the printed price as input.
View Code
P007.c

A shopkeeper offers 10% discount on printed price of a digital camera. However a customer has to pay 6% GST on the remaining amount. WAP to calculate and display the amount to paid by the customer, taking the printed price as input.

A shopkeeper offers 30% discount on purchasing an item whereas the other shopkeeper offers 2 successive discount of 20% and 10% for purchasing the same item. WAP to caompute and display the discounted price of the item by taking the price as input.
View Code
P008.c

A shopkeeper offers 30% discount on purchasing an item whereas the other shopkeeper offers 2 successive discount of 20% and 10% for purchasing the same item. WAP to caompute and display the discounted price of the item by taking the price as input.

WAP to calculate gross and net salary by accepting basic salary as input. IMP :	DA = 30% of Basic Pay 		HRA = 20% of Basic Pay 		PF = 12.5% of Basic Pay Gross Salary = Basic Pay + DA + HRA Net Salary = Gross Salary - PF
View Code
P009.c

WAP to calculate gross and net salary by accepting basic salary as input. IMP : DA = 30% of Basic Pay HRA = 20% of Basic Pay PF = 12.5% of Basic Pay Gross Salary = Basic Pay + DA + HRA Net Salary = Gross Salary - PF

WAP to find and display the difference between compound Interest and Simple Interest. Take principle amount as input. Hint :	si = (p * r * t) / 100 		a = p * ((1 + (r / 100)) ^ t) 		ci = a - p
View Code
P010.c

WAP to find and display the difference between compound Interest and Simple Interest. Take principle amount as input. Hint : si = (p * r * t) / 100 a = p * ((1 + (r / 100)) ^ t) ci = a - p

The time period of a simple pendulam is given by the formula : 	t = 2 * pi * square_root(l / g) WAP to calculate T take length(L) and gravity as input
View Code
P011.c

The time period of a simple pendulam is given by the formula : t = 2 * pi * square_root(l / g) WAP to calculate T take length(L) and gravity as input

WAP to swap two integer variable without using third  variable
View Code
P012.c

WAP to swap two integer variable without using third variable

WAP to swap two integer variable without using third  variable
View Code
P013.c

WAP to swap two integer variable without using third variable

WAP to accept the diagonal of square. Find and display the area and perimeter of the square.
View Code
P014.c

WAP to accept the diagonal of square. Find and display the area and perimeter of the square.

WAP to accept number of days and display it after converting into number of years, months and days
View Code
P015.c

WAP to accept number of days and display it after converting into number of years, months and days

WAP to calculate and display radius of a circle by taking the area as input
View Code
P016.c

WAP to calculate and display radius of a circle by taking the area as input

Find maximum between three number.
View Code
P017.c

Find maximum between three number.

WAP to input the cost price and selling price and calculate profit, profit percentage, loss percentage or display the manage nither profit nor loss.
View Code
P018.c

WAP to input the cost price and selling price and calculate profit, profit percentage, loss percentage or display the manage nither profit nor loss.

WAP to input the distance covered and calculate the amount to be paid by the passanger. Distance        Rate =<5KM           RS 90 next 10KM       RS 20/KM next 10KM       RS 10/KM more than 25KM  RS 9/KM
View Code
P019.c

WAP to input the distance covered and calculate the amount to be paid by the passanger. Distance Rate =<5KM RS 90 next 10KM RS 20/KM next 10KM RS 10/KM more than 25KM RS 9/KM

WAP to calculate and display the maturity amount taking the sum and number of days as input. No. of Days         Rate of Interest Upto 180 days       5.5 % 181 to 364 days     7.5 % exact 365 days      9.0 % more than 365 days  8.5 %
View Code
P020.c

WAP to calculate and display the maturity amount taking the sum and number of days as input. No. of Days Rate of Interest Upto 180 days 5.5 % 181 to 364 days 7.5 % exact 365 days 9.0 % more than 365 days 8.5 %

WAP to input a positive number and check if it is a perfect square number or not.
View Code
P021.c

WAP to input a positive number and check if it is a perfect square number or not.

WAP to find out smallest of three numbers without using if_else block.
View Code
P022.c

WAP to find out smallest of three numbers without using if_else block.

WAP to input the total cost and compute the amount to be paid by the customer.
View Code
P023.c

WAP to input the total cost and compute the amount to be paid by the customer.

WAP to check whether a year is leapyear or not.
View Code
P024.c

WAP to check whether a year is leapyear or not.

WAP to input the electricity unit consumed and calculate the total bill amount according to the given condition : for 1st 50 unit            Rs. 0.50 per unit next 100 unit              Rs. 0.75 per unit next 100 unit              Rs. 1.20 per unit above 250 unit             Rs. 1.50 per unit And additional charge of 20 percent is added to the bill.
View Code
P025.c

WAP to input the electricity unit consumed and calculate the total bill amount according to the given condition : for 1st 50 unit Rs. 0.50 per unit next 100 unit Rs. 0.75 per unit next 100 unit Rs. 1.20 per unit above 250 unit Rs. 1.50 per unit And additional charge of 20 percent is added to the bill.

WAP to input sum (p), rate of interest (r), time (t) and type of interest ('s' for simple interest amd 'c' for compound interest). Calculate and display the interest earned si = (p * r * t) / 100 compoundInterest = p * ((1 + r / 100)^t - 1)
View Code
P026.c

WAP to input sum (p), rate of interest (r), time (t) and type of interest ('s' for simple interest amd 'c' for compound interest). Calculate and display the interest earned si = (p * r * t) / 100 compoundInterest = p * ((1 + r / 100)^t - 1)

Purchase        Discount on     Discount on Amount            Laptop         Desktop --------        -----------     ----------- Upto 20k            3.0%            5.0% 20001 - 50k         5.0%            7.5% 50001 - 75k         7.5%           10.5% more than 75k      10.0%           15.0% WAP to input amount of purchase and type of purchase ('L' : laptop, 'D' : desktop) and display the discount amount and the discounted price (Net Amount).
View Code
P027.c

Purchase Discount on Discount on Amount Laptop Desktop -------- ----------- ----------- Upto 20k 3.0% 5.0% 20001 - 50k 5.0% 7.5% 50001 - 75k 7.5% 10.5% more than 75k 10.0% 15.0% WAP to input amount of purchase and type of purchase ('L' : laptop, 'D' : desktop) and display the discount amount and the discounted price (Net Amount).

WAP to calculate factorial of a number
View Code
P028.c

WAP to calculate factorial of a number

WAP to perform addition of first n natural numbers. sum = 1 + 2 + 3 + ...
View Code
P029.c

WAP to perform addition of first n natural numbers. sum = 1 + 2 + 3 + ...

Display the first 15 terms of the series.
View Code
P030.c

Display the first 15 terms of the series.

Find the sum of the series
View Code
P031.c

Find the sum of the series

WAP to input a number and check whether it is a Niven number or not. (When a number is divisible by its sum of digit) e.g. : n = 126
View Code
P032.c

WAP to input a number and check whether it is a Niven number or not. (When a number is divisible by its sum of digit) e.g. : n = 126

WAP to calculate the sum of even digits and odd digits. Number will be provided by user.
View Code
P033.c

WAP to calculate the sum of even digits and odd digits. Number will be provided by user.

Get sum of even position digit and odd position digit
View Code
P034.c

Get sum of even position digit and odd position digit

WAP to input an int number and display the product of the successors of even digits of the number entered by user.
View Code
P035.c

WAP to input an int number and display the product of the successors of even digits of the number entered by user.

sum = a + (a^2)/2 + (a^3)/3 + ... + (a^n)/n
View Code
P036.c

sum = a + (a^2)/2 + (a^3)/3 + ... + (a^n)/n

sum = 1 + 1+2/1*2 + 1+2+3/1*2*3 + ... + 1+2+3+...+n/1*2*3*...*n
View Code
P037.c

sum = 1 + 1+2/1*2 + 1+2+3/1*2*3 + ... + 1+2+3+...+n/1*2*3*...*n

Write a program to check prime number
View Code
P038.c

Write a program to check prime number

Write a program to print all the factors of a postive integer
View Code
P039.c

Write a program to print all the factors of a postive integer

Write a program to calculate HCF of two positive number
View Code
P040.c

Write a program to calculate HCF of two positive number

Write a program to enter two numbers and check they are co-prime or not. co-prime when HCF = 1
View Code
P041.c

Write a program to enter two numbers and check they are co-prime or not. co-prime when HCF = 1

Write a program to accept a number and check whether the number is twisted prime or not.
View Code
P042.c

Write a program to accept a number and check whether the number is twisted prime or not.

Write a program to check palindrome number.
View Code
P043.c

Write a program to check palindrome number.

Write a program to input a number and check whether the number is Pronic number or not. Pronic Number: The number which is the product of two numbers which is the product of two consecutive integer. Ex: 20 = 4 * 5
View Code
P044.c

Write a program to input a number and check whether the number is Pronic number or not. Pronic Number: The number which is the product of two numbers which is the product of two consecutive integer. Ex: 20 = 4 * 5

Make this pattern for input n. Pattern : 1 1   2 1   2   3 1   2   3   4 1   2   3   4   5
View Code
P045.c

Make this pattern for input n. Pattern : 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5

Make this pattern for input n. Pattern : 1 2   1 3   2   1 4   3   2   1 5   4   3   2   1
View Code
P046.c

Make this pattern for input n. Pattern : 1 2 1 3 2 1 4 3 2 1 5 4 3 2 1

Make this pattern for input n. Pattern : 5 5   4 5   4   3 5   4   3   2 5   4   3   2   1
View Code
P047.c

Make this pattern for input n. Pattern : 5 5 4 5 4 3 5 4 3 2 5 4 3 2 1

Make this pattern for input n no of row. Pattern : 1 2   3    4   5   6 7   8   9   10 11  12  13  14  15
View Code
P048.c

Make this pattern for input n no of row. Pattern : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Make this pattern for input n no of row. Pattern : # @   @ #   #   # @   @   @   @ #   #   #   #   #
View Code
P049.c

Make this pattern for input n no of row. Pattern : # @ @ # # # @ @ @ @ # # # # #

Write a program to input a number and check whether it is Disarium Number or not. Note : A number is said to Disarium if sum of its digit powered by with their respective position is equal to the original number.
View Code
P050-SHORT.c

Write a program to input a number and check whether it is Disarium Number or not. Note : A number is said to Disarium if sum of its digit powered by with their respective position is equal to the original number.

Write a program to input a number and check whether it is Disarium Number or not. Note : A number is said to Disarium if sum of its digit powered by with their respective position is equal to the original number.
View Code
P050.c

Write a program to input a number and check whether it is Disarium Number or not. Note : A number is said to Disarium if sum of its digit powered by with their respective position is equal to the original number.

Write a program to input two number and check whether they are Amicable Pair or not Example :  Sum of Proper Divisors of 220 (1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110) = 284 Sum of Proper Divisors of 284 (1, 2, 4, 71, 142) = 220
View Code
P051.c

Write a program to input two number and check whether they are Amicable Pair or not Example : Sum of Proper Divisors of 220 (1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110) = 284 Sum of Proper Divisors of 284 (1, 2, 4, 71, 142) = 220

Print the sum of this series for upto n element. Series: 1 + (1 + 2) + (1 + 2 + 3) + (1 + 2 + 3 + 4) + ... + (1 + 2 + 3 + ... + n)
View Code
P052.c

Print the sum of this series for upto n element. Series: 1 + (1 + 2) + (1 + 2 + 3) + (1 + 2 + 3 + 4) + ... + (1 + 2 + 3 + ... + n)

Print all pattern
View Code
P053.c

Print all pattern

WAP to check Krishnamurty number using user defined methods/functions.
View Code
P054.c

WAP to check Krishnamurty number using user defined methods/functions.

WAP to print n terms of Fibbonacci Series (Starting from term 0)
View Code
P055.c

WAP to print n terms of Fibbonacci Series (Starting from term 0)

WAP to swap the value of a and b using user defined method.
View Code
P056.c

WAP to swap the value of a and b using user defined method.

WAP to display the series using user defined method. 0, 7, 26, 63, ... upto n terms using void series(int n)
View Code
P057.c

WAP to display the series using user defined method. 0, 7, 26, 63, ... upto n terms using void series(int n)

WAP to display ASCII code of Alphabets (A - Z) using void displayASCII()
View Code
P058.c

WAP to display ASCII code of Alphabets (A - Z) using void displayASCII()

Write a program to find the sum of array elements using following fuctions int array_sum(int a[], int n); void get_data(int a[], int n); void dispaly(int a[], int n);
View Code
P059.c

Write a program to find the sum of array elements using following fuctions int array_sum(int a[], int n); void get_data(int a[], int n); void dispaly(int a[], int n);

write a C program to count the occurrences of a given element in an array using a user-defined function. Create a function int count_occurrences(int arr[], int n, int target) that countts how many times target appears in the array.
View Code
P060.c

write a C program to count the occurrences of a given element in an array using a user-defined function. Create a function int count_occurrences(int arr[], int n, int target) that countts how many times target appears in the array.

Write a C program to find the sum of even elements in an array using a user defined function. Define a functions int sumEven(int arr[], int n) that returns the sum of all even elements in the array.
View Code
P061.c

Write a C program to find the sum of even elements in an array using a user defined function. Define a functions int sumEven(int arr[], int n) that returns the sum of all even elements in the array.

Write a C program to find the smallest and largest in an array using user-defined functions. Define two functions int findSmallest(int arr[], int n) and int findLargest(int arr[], int n) that return the smallest and largest elements in an array, respectively.
View Code
P062.c

Write a C program to find the smallest and largest in an array using user-defined functions. Define two functions int findSmallest(int arr[], int n) and int findLargest(int arr[], int n) that return the smallest and largest elements in an array, respectively.

Write a C program to find all Niven in an array. Define a user-defined function int isNiven(int num) that returns 1 if the numbers is a Niven number, otherwise returns 0. A Niven number (also known as a Harshad Number) is an integer that is divisible by the sum of its digits.
View Code
P063.c

Write a C program to find all Niven in an array. Define a user-defined function int isNiven(int num) that returns 1 if the numbers is a Niven number, otherwise returns 0. A Niven number (also known as a Harshad Number) is an integer that is divisible by the sum of its digits.

Write a program to merge two sorted integer arrays to form a single sorted array.
View Code
P064.c

Write a program to merge two sorted integer arrays to form a single sorted array.

Write a program to reverse a string
View Code
P065.c

Write a program to reverse a string

WAP to find the length of a string using i) Library Method ii) User defined method
View Code
P066.c

WAP to find the length of a string using i) Library Method ii) User defined method

Write a program using function which concatenates two string s1 and s2 in to a third string
View Code
P067.c

Write a program using function which concatenates two string s1 and s2 in to a third string

Write a c program that perform the operation of strcmp()
View Code
P068.c

Write a c program that perform the operation of strcmp()

Write a program using user defined method to implement the following JAVA PROG Mastery -> JPM java prog mastery -> JPM Acharya Prafulla Chandra -> JPM
View Code
P069.c

Write a program using user defined method to implement the following JAVA PROG Mastery -> JPM java prog mastery -> JPM Acharya Prafulla Chandra -> JPM

Write a program to perform addition of two complex number having fields 'real' and 'img' of type integer.
View Code
P070.c

Write a program to perform addition of two complex number having fields 'real' and 'img' of type integer.