The working mechanism of this source code is similar to above source code. But, it uses the function fopen() to open the file.txt file in reading mode i.e. function is called with “file.txt” and “r” as argument. After the file is opened in reading mode, the content of file.txt is displayed on the screen and file is closed.
This Program multiply the elements of the two 3 x 3 matrices.
This program evaluates and Compute Quotient and Remainder when an integer is divided by another integer. In this program, the user is asked to enter two integers (dividend and divisor) which are stored in variable dividend and divisor respectively. Finally, the quotient and remainder are displayed as output.
Random numbers are numbers that occur in a sequence such that two conditions are met: (1) the values are uniformly distributed over a defined interval or set, and (2) it is impossible to predict future values based on past or present ones. Random numbers are important in statistical analysis and probability theory. After the successful compilation of the program, this program displays the following output: Ten random numbers in range [1-100] are as follows: 42, 68, 35, 1, 70, 25, 79, 59, 63, 65
Perfect number is a positive integer which is equal to the sum of its proper positive divisors. After the successful compilation of the program, this program displays the following output: Enter any number to check perfect number: If user enters 6 then it displays a message like 6 is a perfect number.
As we know that time is the most important concern in our life. To do any task easily, We have to use software to perform it in a simpler manner. Software is a set of programs with related documents. The Software Program or Program is a set of instructions to do a specific task.
Number is an arithmetical value, expressed by a word, symbol, or figure, representing a particular quantity and used in counting and making calculations. In this Program first of all User Enter the an integer number then Program display the sum of digits of inputed number as an output.
In this Program, the if…else statement is used to check whether a character entered by the user is alphabet or not? The alphabets A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, and Z are called Alphabet. All other characters except these 26 letters are not an Alphabet. If User entered any character rather than 26 Alphabet than a print like # is not an alphabet.
This program first takes length of parallel sides and height as input form user using scanf function and stores it in three floating point variables. Then it calculates the area of trapezium using the formula given above. Then, it prints the area of trapezoid on screen using printf function.
Are you want a demonstration of The C Program that reverses an Integer number? This Program reversing the sequence of digits in an Integer. After the successful compilation of the program, a message is displayed on the screen as Please! Enter a string that you want to reverse: Suppose, User, entered 11001 then again a message is displayed as The Equivalent Reversed Number is 10011. The internal execution of the program depends upon the previous demonstration of Reverse an Integer number.
In this Program, User will enter the three sides of the triangle a, b, c. Then, Calculating the Perimeter of the Triangle. Moreover, calculating the semi perimeter using the formula (a + b + c) / 2 and calculating the Area of a triangle using Heron’s Formula: sqrt(s * (s - a) * (s - b) * (s - c)). After the successful execution of the program the final area of a triangle is shown on screen.
After the successful compilation of the program, In this program, we used two variables num, and i. The variable num is used to store the input integer number and the variable ‘i’ is used to iterate the loop. Product of the number is given by num*i;
This Program shows matrix addition through the addition of corresponding elements of the matrices.
Never Miss an Articles from us.
Contribute the Community.