by Dinesh Thakur

This is C Program to Sum of Two Matrix. In this program user asks to add two matrixes. The array type variables are declared for containing the value. Here loop statement comes in use for laying the condition true nested for loop used for print the matrix in it. Then after the condition as follows the loop statement value is been entered for 2x2 matrix to print. Then another for loop to add the both matrix on it. And display the result on screen.

 
by Dinesh Thakur

The program segment given below uses an switch statement to determine the number of days in a given month (mm). The switch statements to handle the following cases: months having 31 days, months having 30 days, February having either 29 or 28 days.


 
by Dinesh Thakur

In this program user ask to delete character from String using pointer concept. User declares char type array variable. User using malloc() function for the allocate the memory to the variable. Then user asks to enter the string then shifted the ptr to str variable for address reference. Then user puts the while condition to verify condition. In condition while (*ptr! =NULL) then if (*ptr!=ch) is that all the conditions got true the *ptr2 will be *ptr2++ with increment operator. And in the end the given result will be on the screen at the end.



 
by Dinesh Thakur

In this program user ask to count the line in a file. User declares the required variable for storing the value and some are of pointer type. User put the method for opening file and using if-else condition to vary the condition if content is not found then terminate else with the use of while condition read the content until (ch != EOF). Then varying the condition the counted lines are on the display on the screen. In the end a method in end to close the file.

 
by Dinesh Thakur

In this program user asks to text conversion from Lower case to uppercase. User declares the char type variable. User also uses the loop statement that will execute the concept of conversion. The other function for put char that has to get the character that converted. In the end the display the result on the screen as well.

 
by Dinesh Thakur

In this program user ask to find the exponential Power of value. Exponents are shorthand for repeated multiplication of the same thing by itself. User declares double type variable or float and int. two variables temp and expo assigned value 1. User asks to enter the value for expo and then the loop statement configures the condition to evaluate output. In loop statement the term variable is been manipulated with the x or I. and after all the manipulation the output is print out on the screen.

 
 
by Dinesh Thakur

This is C Program to calculate the sum of the elements of each row & column. A matrix is made of rows and columns. The program will add all the rows and the columns of the matrix.

 
by Dinesh Thakur

In this program user will take command to copy the content from one file to other file with the help of file handling concept. As required user declare the variables for function regarding here user must have to create a file with content in it for copying as user set the control statement that if (args!=3) then insufficient arguments message will be on the screen. In next move user made a condition if (fp1==Null) then the existing file can’t be open and the targeted file also been neglected by the control statement. Then awhile condition comes in lime light for vary the condition to copying the file. While (ch!=EOF) until the character not been checked to end of file. Put the content of fp1 to targeted place. And then a message appears file copied on the screen as result.

 
by Dinesh Thakur

Let us use an array of characters (str) to store the string and variables nletter, ndigit, nspace and nother to count the letters, digits, white spaces and other characters, respectively.

 
by Dinesh Thakur

In this program user ask to swap the numbers. User declares the variables for containing the value in it. User define the method with arguments or parameter (*int, int*). Then user assign the value to each variables then print the message to before and after value phase in each variable. Next move to call the function that declares the early in the program. Using swapping method as usual. Display the result on the screen as output.

 
by Dinesh Thakur

This is C Program to Reverse the String using Recursion. In this Program user ask to reverse the string with the use of recursion function. Char type variable is a casual call for containing the value. In this program majorly the reverse function will come in use and some where the use of if condition too. The first instance program asks to put the line of text. Then after the reverse function and so on but in next move the if condition comes to check the condition for reversing the string if it’s take right then the reverse function will reverse the function and then display the reversed content on the screen.

 
by Dinesh Thakur

This is C program where user asks to trace a matrix with giving the order of matrix and print it. Here user declares variables that are mandatory for storing the value with it. Some variables are array type to holding value multiple. User asks to enter the no. of rows and columns as order of matrix. And then enters a number then after user varies the loop statement for situation handling to print a matrix. Nested loop statements are used in this program to elaborate the condition itself for tracing the matrix. A printing message for the matrix elements. And then display matrix on the screen as a result.

 
by Dinesh Thakur

A year is leap if it is divisible by 4 but not by 100 or is divisible by 400. Thus, 1996, 2000 and 2004 are leap years but 1900, 2002 and 2100 are not. The program segment given below determines whether a given year (of type int) is leap or not.


 
by Dinesh Thakur

This is C program that asks user to find out the discount against salary. User declares the variables for storing the value in it. Here user asks to put the basic salary for finding out the discount against salary. For this procedure user declares the nested if-else condition. if(a==1000) then the discount will be 200 and if a=1500 then 500 and at the else condition no discount will be printing on the screen a s result as per. Here nested if-else condition comes into the lime light.

 
by Dinesh Thakur

In this example, the if-else-if ladder takes decision based on the value of percentage of marks (percentage) calculated and displays the appropriate division. Here, the value of the percentage calculated for inputted data 80 50 75 evaluates to be 68.33. On the basis of this value, the first condition in if-else-if ladder (percentage>=60 & percentage<100) which evaluates to be true so it displays the message First Division and skip the remaining conditions.

 
by Dinesh Thakur

The roots of a quadratic equation are real if discriminator b2-4ac is greater than or equal to zero; otherwise they are complex conjugate. However, if the roots are complex conjugate, i.e., if b2-4ac<0, the evaluation of expression sqrt (b*b-4*a*c) causes a domain error and the program halts abruptly.


 
by Dinesh Thakur

In this program user ask to check whether the number is even, odd, -ve, +ve. For this user need to use control statement like if-else. User put the condition if (a==0) then number is zero. if (a%2==0 && a>0) number is even and positive. if (a%2==0 && a<0) number is even and negative or if (a%2!=0 && a>0) number is odd and positive these are some conditions to verify the number pahse. And display result on the screen.

 
by Dinesh Thakur

In this program, an array type variables with elements (10) created for which contain the data as required for them. These created variables are character (char) type data type. These variables will use to contain the string data that is been used for the checking condition as required for string functions. And in the End the data entered will be displayed on the screen.



 
by Dinesh Thakur

In the program integer type variable declare(x,y) which contains the value. To swap the variables we need to declare them with unique values. To swap the variables without using third variable and in this case we also do not use the Temp (temporary) variable. Some operators for manipulation used for swapping the variable.

 
by Dinesh Thakur

In this program user will find out the average of students scores. To perform this action the required info and variables are essentials. Like user declare array type variable and float type that will contain the value to be declared. After that user ask to enter the value like subject marks in the end process user add all the scores and divide them all with total subjects to find out the average of students. And to use printing method shown out the result on the screen.

 
by Dinesh Thakur

If the amount deposited in a bank (i.e., principal), number of years and interest rate are denoted asp, n and r, respectively, compound interest (compounded annually) as p(1+r/100)n. The program segment given below calculates and prints compound interest on deposit.

 
by Dinesh Thakur

This is c program that asks user to find out the Area of a circle. User need to declare the math function header file for calculation along with required variables like radius or area. User asks to enter radius of a circle for find out the area. User then uses the method to find out the area of a circle. Then too display result on the screen as result.

 
by Dinesh Thakur

In this program user ask to convert all the lower case character into uppercase. For this user declare two variable named lower and upper. Here in the program user ask to enter the character for converting. Then user use the method to convert like puts the lower variable into getchar() condition whenever it gets character it will turn into uppercase and then trespass the value to upper variable and print them in the end with printing method.

 
by Dinesh Thakur

The function call pow(a, b) is used to evaluate ab, The pow function gives a domain error if the value of a is zero and b is less than or equal to zero or if a is negative and b is not an integer.


 
by Dinesh Thakur

This is C program that asks user to find out the size of int. there are too many data types in programming languages. All are same in using like any content acquired the memory as well as data types also acquire the memory like char, integer, float or double etc. integer data type acquire the 2 bytes. This is the program that uses to define the data type memory acquiring status. Using some methods to find out the display as result.



 
by Dinesh Thakur

The function sizeof () gives the number of bytes allocated to store the argument of the function. For example, sizeof (x) will give the numbers of bytes allocated for storing x. Similarly, sizeof (int) will give number of bytes allocated for storing an int number. The number of bytes allocated for a particular data type depends on the computer system, the operating system, and the compiler used.



 
by Dinesh Thakur

This is C program that asks user to define the size of data types acquired by them. Data types are known as those elements that tells the user which kind of data elements they have for example integer type for numeric value, char type for characters. All the data types have their limits for numerical expressions like char is 0-255 bits.



 
by Dinesh Thakur

This is C program that asks user to print a menu screen on display. For this user declare some variables to storing the value in it. Here user uses currency converter method for menu screen. User only prints the message to currency conversion. And some new line tag or space tag used for space ad new line composition. printing the quoted message on the screen as the result.

 
by Dinesh Thakur

In this program the two numbers to be swapped from each other place with the use of third variable. In program the variables declare for storing the value in it. Here three variables are also declared (a,b,c) the use of only two numbers the swapping will happen. The first number shifted to third variable and then to other variable the reverse phase will be on the move to swap both numbers. And other functionality also comes in light for displaying the result on the screen.

 
by Dinesh Thakur

 This is C Program for define the Bitwise operator. Binary system operator known as bitwise operator like Left shift or right shift operator. The operands value is moved left or right by the number of bits specified by the operand position right or left. To define this condition user declares the variables c1, c2, c3. Here user define char type variables and define the value as static mode manually. User put the condition to define bitwise operator c3 = c1 & c2. And display output as result on the screen.

 
by Dinesh Thakur

This is the C program for converting a character into ASCII value.

 
by Dinesh Thakur

This is C program that ask user to define the Bitwise XOR operator. This operator in C compares each bit of its first operand to the corresponding bit of its second operand. If one bit is 0 and the other bit is 1, the result will bit is set to 1 Otherwise 0.

 
by Dinesh Thakur

In this program user ask to define the left shift operator. Left Shift Operator The left operands value is moved left by the number of bits specified by the right operand. User declares required variables for storing the value. User put a condition to shift the bits from right to left c3 = c1<<2. Display result on the screen.

 
by Dinesh Thakur

This is c program that ask user to find out the interest of value. Here user declares the variables for containing the value in it. User has all components to find out the interest of value. User asks to enter the number for program execution and use the method of Simple interest. Display the result on the screen as output.

 
by Dinesh Thakur

In this program integer type variables are created which contained data of five subjects that are given. Then some variables of floating type data type also created for required data containing decimal values from user.



 
by Dinesh Thakur

This is C program that ask to find out the quadric equation. User need to declare the variables that can contain the value in it. Here user asks to enter the value for each variable declared in the equation. User asks value on run time situation. Core step of this program to define the quadric method for equation execution. As user put on the method the result is on display as output.

 
by Dinesh Thakur

In this program user ask to calculate the gross salary of employees. To calculate the gross salary all the facts in salary like da,hra,basic salary also included. The addition of all salary element show out the gross salary chart.

 
by Dinesh Thakur

This program user ask to define the getch() function for receiving user selection about character that press on key board. User declares the variables that use to contain the value. In printing criteria user put a query about “do u want to continue (y/n)”. Here if user press ‘Y’ then the character pressed will be selection word as output else the condition will terminate.

 
by Dinesh Thakur

The function getchar () read and write (display) single character. The function getchar () reads and returns the next character from standard input stream. The standard input is from keyboard. If the function encounters end-of-file character, it returns EOF. Also, if an error occurs in reading, then also the function returns EOF. The prototype of the function is

 
by Dinesh Thakur

Program illustrates the application of operator modulus(%) to random numbers generated in order to limit the maximum size of random numbers. This is helpful in sampling problems as well as in playing of dice. In dice play, the maximum value that can be obtained is 6. The code for such a case is illustrated below.

 
by Dinesh Thakur

This is C program that asks user to find out the square root of a number. for this operation user declare a variable for fetching the output on it user also declare a math.h header file this file contains all the math functions for required operation. Then user asks a number to find out the square root put on the square root function the last move to fetches out the result as output on the screen.

 
by Dinesh Thakur

This is C program where user asks to calculate the exponential value of Number. Exponential is known to a variables raised to the power of something. For example, 10 to the power of 2 is 100 (10x10). For this process user declare the required variables for this after assign the value to variable. User put out the method to find out exponential value. And fetch out the result as output on display.

 
by Dinesh Thakur

In this program user ask to calculate the Absolute value of integer Parameter. User declares some required variables for the storing value in it. Here user use math function for calculate the absolute value. In abs function the negative value is been denied. Then user uses the absolute function for displaying the result on the screen.

 
by Dinesh Thakur

 In this program user ask to find out the Power of numeric value as cubic, trigonometric etc. to print the table of powers user need to declare all the power functions. In first instance user declare math.h header file this file contains all the power () functions. User declares integer type and float type variables for process to print the power tables. User asks to enter the value for printing the power table. After declare the value user put the method to find the powers of value like cubic, quadric etc. user in the end print the value through the printing method.

 
by Dinesh Thakur

Computer instructions have the provision of directly adding or subtracting unity to a variable. So, if we use this facility, the operation is quicker than the operation for the statement A = A+ 1; . Therefore, for increasing and decreasing the values of integral objects by unity, it is better to make use of increment operator (++) and decrement operator (- -) , respectively. Another provision with these operators is that the operators may be placed before or after the identifier of the variable. When the operators + + and -- are placed before the variable name, these are called pre-increment and pre-decrement operators, respectively. For instance,



 
by Dinesh Thakur

In this program user ask to define the left shift operator. Left Shift Operator The right operands value is moved left by the number of bits specified by the right operand. User declares required variables for storing the value. User put a condition to shift the bits from Right to left. Display result on the screen.

 
by Dinesh Thakur

This is C program that asks user to return the character in Lower Case. User just declares a character and put char method to evaluate the condition. Display result on the screen as output.

 
by Dinesh Thakur

This is C program that asks user to return the character in Upper Case. User just declares a character and put char method to evaluate the condition. Display result on the screen as output.

 
by Dinesh Thakur

In this program user ask to define the ternary operator. User declares some required variables that contain values in it. Ternary operator denote by ?: this can be used as a shortcut for an if-else statement. Here user declare a condition to evaluate the method user ask to enter the value. b= (a>5?1:0); and display result on the screen as output.

 
by Dinesh Thakur

String copy is one of the basic operations in manipulating strings. In this operation, all the characters in the source string, including the null terminator, are copied to the target string making it an exact replica of the source string.

 
by Dinesh Thakur

This is c program that user has to show how to enter the content through string copy function. User declare array type variable so that use to contain the data in it. Here user declares the strcpy function to initialize the name as content. In the last user display the print method to show the output in result.

 
by Dinesh Thakur

This is C program here user will find out the length of line (string) for this user declare the variables that contain value for it and string functions for string execution. Declaring a variable with array parameter user ask to enter the line as required in quoted area. After that user put the method about string functions along with it display the result as output as result.

 
by Dinesh Thakur

This is C program that asks user to find the area of a triangle using math’s function. Here user declares some variables that use to store the value of it. User asks to enter the value of triangle three sides of triangle. Here after value user using the method to find the area of triangle. And then print the result on the screen.

 

Page 2 of 2