Sunidhi Bansal has Published 1085 Articles

Program for triangular patterns of alphabets in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 08:32:35

321 Views

Given a number n, the task is to print the triangular patterns of alphabets of the length n. First print the n characters then decrement one from the beginning in each line.The triangular pattern of alphabet will be like in the given figure below −Input − n = 5Output Input − ... Read More

Profit and loss Problems using C

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 08:29:46

3K+ Views

Given a certain cost price(cp) and a selling price(sp) of an unknown product or a service, our task is to find the profit earned or loss suffered using a C program where if the profit is earned should print “Profit” and it’s amount or if the loss is suffered “Loss” ... Read More

Product of all prime numbers in an Array in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 08:27:34

281 Views

Given an integer array arr[] with some elements, the task is to find the product of all the prime number of that numbers.Prime number are those number which are either divided by 1 or the number itself, or a prime number is a number which is not divisible by any ... Read More

Product of given N fractions in reduced form in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 08:24:17

222 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 ... Read More

Program to Add Two Complex Numbers in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 08:21:01

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 ... Read More

Product of middle row and column in an odd square matrix in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 08:18:56

249 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 ... Read More

Program to compare two fractions in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 08:15:19

713 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 ... Read More

Program to check if an array is sorted or not (Iterative and Recursive) in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 08:13:30

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 ... Read More

Program to check if a string contains any special character in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 08:10:20

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. − !@#$%^&*()+=-\][‘;/., ... Read More

Product of N with its largest odd digit in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 08:07:52

431 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 ... Read More

Advertisements