To get the output of the this Program, User will Enter temperature in Celsius: 100 Then, Compiler will convert it into Fahrenheit automatically. The final output shown onto the screen is as follows: Enter temperature in Celsius: 100 100 Celsius = 212.00 Fahrenheit
In this Program, the if…else statement is used to check whether an alphabet entered by the user is a vowel or a constant. The five letters A, E, I, O and U are called vowels. All other letters except these 5 vowel letters are called consonants. This program assumes that the user will always enter an alphabetic character.
This Program runs a loop from 2 to 100 and checks for each current number within range that it is prime or not. After the successful execution of the program it displays the list of all prime numbers from 2 to 100. As we know that 1 is not a prime number so we don't need to check it.
This Program stores two integers one by one into the int datatype. After the successful swapping of numbers it will exchange the value of them at once or you can say that it assign a's value to b and b's value to a.
In the successful compilation of the program, a message is displayed on the screen as Please! Enter a string to check if it's a palindrome:This program entered a string by user then store it into a variable after that found its reversed and store it in to another variable if both variables are same then we can say that inputed string is palindrome otherwise that is not a palindrome.
In this Program, The first two elements are respectively started from 0 , 1, and the other numbers in the series are generated by adding the last two numbers of the series using looping. These numbers are stored in an array and printed as output.
In this program, using a for loop, we have iterated over characters of the string from i = 0 to until '\0' (null character) is encountered. In each iteration, the value of i is increased by 1. When the loop ends, the length of the string will be stored in the i variable.
A circle can be defined as a locus (a set of points in a particular position) of points that maintain equidistant from another point called the center. In this Program first of all User Enter the radius of the circle then it shows the area of the circle according to the given radius by using formula. Area is always squarely proportional to the radius.
In this Program, User will enter the length and width of the rectangle into two variables length and width. Then, Calculating the Area of the rectangle using the formula Area = length × width. After the successful execution the final area of a rectangle is shown on screen.
This Program stores an integer into the variable with int datatype. After it is used for the loop it checks all divisors between 2 and the number itself. Then, Compare it is divisible or not by any number rather than 1 and itself. At last If the user input 1 then it shows the 1 is a prime number. Next, If the user inter 23 then it displays 23 is a prime number and Display to enter another number.
In this program, the number of digits of an integer is calculated first and stored in n. And, the pow() function is used to compute the power of individual digits in each iteration of the second for loop.
This program first takes length of base and height form user using scanf () function and stores it in three floating point variables. Then it calculates the area of Parallelogram using the formula Area of parallelogram = base X height. Then, it prints the area of parallelogram on screen using printf () function.
A Decimal Number is constructed with any digit from 0 to 9. For instance, 24 is a Decimal Number constructed from the digits 2 and 4. A Binary Number is constructed with digits 0 and 1. For instance, 11000 is a Binary Number constructed from the digits 1 and 0 which is the value of a Decimal Number 24. This Program will convert any Decimal number entered by the user to its equivalent Binary Number.
In this Program, we will solve this problem using recursion. We will first take base and exponent as input from user and pass it to a recursive function, which will return the value of base raised to the power of exponent(base^exponent).
In this program, three numbers are assigned in to the three variables one by one. Then, compare the two selected of them with the use of comparison operator. Repeat the same process for the other two. After the successful execution of the program the final largest number amongst the three are displayed on the screen.
Never Miss an Articles from us.
Contribute the Community.