 
 Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C Articles - Page 48 of 134
 
 
			
			232 Views
Given the numerator num and denominator den of N fractions, the task is to find the product N fractions and output should be in reduced form.Like in the given figure below we have two fractions ”4/5” and “3/4” we have found the product of those two factions where the numerator of first is multiplied by the numerator of second and the denominator of the first is multiplying the denominator of the second. Now the final result is “12/20” which can be reduced so the output shall be “3/5 ” likewise we have to develop a program to solve the given ... Read More
 
 
			
			10K+ Views
Given are the two complex numbers in the form of a1+ ib1 and a2 + ib2, the task is to add these two complex numbers.Complex numbers are those numbers which can be expressed in the form of “a+ib” where “a” and “b” are the real numbers and i is the imaginary number which is the solution of the expression 𝑥 2 = −1 as no real number satisfies the equation that’s why it is called as imaginary number.Input a1 = 3, b1 = 8 a2 = 5, b2 = 2Output Complex number 1: 3 + i8 Complex number 2: 5 + i2 ... Read More
 
 
			
			262 Views
Given a square matrix, mat[row][column] where row and column are equal and are of odd length means the number of row and column must me odd, i.e, not divisible by 2, the task is to find the product of middle row and middle column of that matrix.Like in the given figure below −ConstraintsMatrix must be a square matrix.Column and rows must be of odd length.Input mat[][] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}Output Product of middle row = 120 Product of middle column = 80Explanation Product of middle row = 4 * 5 * 6 = 120 Product of middle ... Read More
 
 
			
			733 Views
Given two fractions with some numerator nume1 and nume2 and deno1 and deno2 as their respective denominator, the task is to compare both the fractions and find out the greater one. Like we have a fraction 1/2 and 2/3 and the higher one is 2/3 because the value of 1/2 is 0.5 and the value of 2/3 is 0.66667 which is higher.Input first.nume = 2, first.deno = 3 second.nume = 4, second.deno = 3Output 4/3Explanation 2/3 = 0.66667 < 4/3 = 1.33333Input first.nume = 1, first.deno = 2 second.nume = 4, second.deno = 3Output 4/3Approach used below is as follows to solve the problem//baadme likhungaAlgorithmStart ... Read More
 
 
			
			4K+ Views
Given an array arr[] with n number of elements, our task is to check whether the given array is in sorted order or not, If it is in sorted order then print “The array is in sorted order”, else print “The array is not in sorted order”.To solve the above stated problem we can use Iterative or Recursive approach, we will be discussing both.Recursive ApproachSo, what is a Recursive approach? In Recursive approach we recursively call a function again and again until we get the desirable result. In recursive approach the values returned by function is stored in stack memory.Input arr[] ... Read More
 
 
			
			7K+ Views
Given a string str[], the task is to check whether the string contains any special character and if the string have a special character then print “The String is not accepted” else print “The string is accepted”.Special characters are those characters which are neither numeric nor alphabetic i.e. − !@#$%^&*()+=-\][‘;/., {}|:”?`~So in C Programming language we will use if-else approach to solve the problem.Input − str[] = {“tutorials-point”}Output − the string is not acceptedInput − str[] = {“tutorialspoint”}Output − The string is acceptedApproach used below is as follows to solve the problem −Traverse the whole string.Will look for the special ... Read More
 
 
			
			439 Views
Given a number N with we have to product the number with its largest odd digit. If there is no odd digit then print -1.Like we have initialized N with “153” and the largest odd digit in this number is 5 so the result would be the product of 153 with 5 i.e. 153 * 5 = 765 and if the number has no odd digit like 246 then the output must be -1.Input − N = 198Output − 1782Explanation − 198 * 9 = 1782Input − N = 15382Output − 76910Explanation − 15382 * 5 = 76910Approach used below ... Read More
 
 
			
			325 Views
Given two arrays arr1[] and arr2[] of some size n1 and n2 respectively, we have to find the product of maximum element of first array arr1[] and minimum element of the second array arr2[].Like we have elements in arr1[] = {5, 1, 6, 8, 9} and in arr2[] = {2, 9, 8, 5, 3} so the maximum element in arr1 is 9 and the minimum element in arr2 is 2 so the product of both is 9*2 = 18, likewise we have to write a program to solve the given problem.Input arr1[] = {6, 2, 5, 4, 1} arr2[] = {3, ... Read More
 
 
			
			4K+ Views
In this problem, we are given two numbers. Our task is to create a C program for the Bitwise recursive addition of two integers.The logic to find the sum using the Bitwise operations is similar to what we used to do when we were in preschool. For finding the sum, we used to add each digit of the number and if a carry is there, we add it to the next digit.We will do a similar thing, find the sum using the XOR operator and check for the carry using the AND operation. If there is a carry we will ... Read More
 
 
			
			1K+ Views
In this problem, we will learn about the standards that are defined in the C programming language. These are those standard ways in which the program is to be ideally compiled by the compiler as defined by the development community.To understand what I am saying take an easy example of a common C program that you all must have encountered and have seen the issue coming but haven’t got deep into it.The main() function’s void return type −See the following program −void main() { //program code }This program will run ok if we use the turbo c compiler but ... Read More