by Dinesh Thakur

Let us use character arrays fname, mname and lname to store the first name, middle name and last name of a person. The program given below first accepts the full name, i. e., values of fname, mname and lname using a scanf function. Then the name is printed in the desired abbreviated form using a printf function. The initial letters of fname and mname are printed using fname [0]and mname[0], respectively. The program is given below.

 
by Dinesh Thakur

Let us use variable meters of type float to represent length in meters and variables feet and inches of type int and float, respectively, to represent length in the FPS system. Let us also use variable tot_inches of type float to represent the given length in inches. To convert the length in meters to the FPS system, we first determine tot_inches, i. e., given length in inches as

 
by Dinesh Thakur

A character is an uppercase letter if its value in the range 'A' to ' Z ' (both inclusive). The program segment given below tests whether a given character is an uppercase letter or not.

 
by Dinesh Thakur

An alphanumeric character is one that is either an uppercase or lowercase letter or a digit. The statement given below tests whether character ch is an alphanumeric character or not.

 
by Dinesh Thakur

This program segment calculates the sum of integer numbers from 1 to n. Initially, the value of n is read from the keyboard and variable sum is initialized to zero. Then a for loop is set up in which the loop variable j assumes values from 1 to n. For each value of j, the assignment statement included in the for loop is executed and the value of j is added to the previous value of sum.

 
by Dinesh Thakur

 In this program user asks to find out the Student grade and marks. User define strut concept in this program and the array type variable for storing the liable value. Here user asking to enter the required fields like roll no, name and marks of student. After declaring all the user using control statement as nested if-else for marking out the status about passing or fail criteria here user insist a condition if(s[k].m1>=35 && s[k].m2>=35 && s[k].m3>=35) then pass else fail. After finding out this one user find out the total obtaining marks of students.

 
 
by Dinesh Thakur

 In this program required variable are declared for functioning criteria. Then using loop statement for fulfilling the requirement of repeat the process. Then to use if condition to check whether the number is prime or not. After finding the prime number the next process is to elaborate them using while statement or if condition if number division able by declare value then break the statement else it will increase the value for variable and then if (y==x) then return the value as required.

 
by Dinesh Thakur

In this program to Print the Pascal Triangle Two core concepts will be on the trot. The Control statement (if-else), and Loop Statements. There in the program Integer type Variables declare which use to contain the value. Here variable i,j and Num will use in the Loop statement as according the requirement. As required in the program Nested Loop used for fulfilling the condition along within the control Statement.

 
by Dinesh Thakur

In this program user ask to pass array to function. User declare the variables along with functions for process to pass array like void read (), void dis (). Arguments also declared within function to pass value. Array type variable contains the array elements within. User asks to enter the value as regarding. And then user call the function for passing value to array in a function user declares for loop for to print a value. The other function is been also call and loop statement also declare for another printing method. And display on the screen.

 
by Dinesh Thakur

This is a C program where user asks to enter the value of matrix (order of matrix) and to find the transpose of matrix order. Means the rows will convert through columns what else the order of matrix. 

 
by Dinesh Thakur

Let us use variables a, b and c (all of type int) to represent three integer numbers and variable max (also of type int) to represent the maximum of them.

 
by Dinesh Thakur

This program asks user to find out the cos (Cosine) theta value. Cosine is a trigonometric element that uses in the math function. User defines the PI value for functions user also declares the variables for the required condition. User ask to enter the value for the X. then it’s manipulated by PI and trespass the value to cosz=term and further passes to loop statement for printing out the output for cosine value on to the display.

 
by Dinesh Thakur

This program asks user to check whether the given char code is ASCII or not. ASCII code means the character code that brings in a numeric form for every character so that computer can read the content because computer only understands the machine language or binary system. ASCII stands for (American standard code for information interchange). There are different type of ASCII code like for Capital characters ASCII code numeric value starts from 65 (A=65) or small characters like a starts from 97 (a=97).



 
by Dinesh Thakur

 A structure includes many variables into one. Works as a Report card that has name, marks and total. The record would be a structure. The structure then is used to group a set of similar data not forming a new data type.



 
by Dinesh Thakur

This is program that ask user to check whether the given number is odd or even. That number divided by odd number Is odd else it is even. In this program user declare required variables that are use to contain the value. And the control statement also used like if else for checking the manipulated condition. If the given digit division able with odd number then it will be odd else it will be even number.

 
by Dinesh Thakur

In this program user checks the logic about numeric value that will it be Division able with 5 or not. To check this declares a variable of integer type. And a logic will be used along with the Modulus operator(%).that will be manipulate with the numeric value and control statement (if-else) used if the numeric value is dividable than output will be ok else it will be reverse. 

 
by Dinesh Thakur

This is C program that ask user to check the day in week that is been selected. For this user need to declare the variables for this and the user also uses the switch statement for choice base condition to chose the day in a week. As user declare simple switch statement each case statement for every day after declaring the case statement user ask to put a number the number will be from 1-7 otherwise it will be an invalid number. default case shows the message invalid number if the number out of case that user select.

 
by Dinesh Thakur

A given character is a vowel if it is one of the following characters: A, E, I, O and U. The switch case given below tests whether a given character is a vowel or not.

 
by Dinesh Thakur

In this program user ask to make sum of upper and lower triangle of matrix. In this program user declare the array type Variable after declaring value to the variable if statement will be use to check whether the matrix is square or not. Else it will be going to enter elements for matrix. Loop statement will use to calculate the procedure for elements. For loop and control statements will use the procedure to make it. Then a print method will use to display the sum of upper triangle.

 
by Dinesh Thakur

In this program, two variables of array type element declared. Which contains the value of declared variables and Loop statement will also use to be execute the situation. The loop statement will elaborate its functioning until the condition get false. The other function is to be comparing if (m! = n) that will end the functioning of add the Matrix given components must be define all the conditions true. And the result as output also displayed on the screen as well.

 
by Dinesh Thakur

 In this program user ask to compute Sine (trigonometric function) Series. The Variable of float or integer type declared that will be use to contain the value. User asks to enter the value and then the computation of PI function described. Here term variable used for temporary value container as in the program this variable contain the x1 and then swapped for Sine. For loop statement also been used for varying the condition. Then using compatible condition the output is displayed.

 
by Dinesh Thakur

In this program user asks to replace the string from existing one. User declares required char type variables that will be used to store the value. Here in operation mode user declare nested for loop statement in that statement user elaborate the variables that are used to functionality mode. Here in other type mode user also use if condition along within do while loop. If (l1>=l2) condition got true than do while loop will come in function. In do while condition for loop also exists for replacing the character and an if-else condition too. Condition going to be check that if the character exists in the string or not the condition got true then it will replace the character. And display the result on the screen.

 
by Dinesh Thakur

 This is C Program Write a Magic Number Program. In this program user ask to guess whether the guessed number is correct or not. The casually in this program the Control Statement will be used like if-else. If the guessed number is equal to the number that set for variable then it’s right else it will be wrong the variable declared which use to contain the given value for condition checks out. After the condition got completed the result will be on the display.

 
by Dinesh Thakur

In this program user ask to reverse the Entered number. User declares the required variables for storing the value. User asks to enter the number. User declares the loop statement for reversing the number. Here user also declares the swapping method for this convention like b=a%10, c=a/10, a=c. printing out the condition on display as result on the mark.

 
by Dinesh Thakur

This is C program to check out the content is lower case or uppercase. Core concept is to show the if the content CH is lower case then Non Zero result will be display as result else the result will zero. For this user declare some required variables for containing the values. Then user define if statement along with for loop. The condition which gets the true will display as result on screen.

 
by Dinesh Thakur

This is c program that asks user to print the number on screen. User declares some variables that use to contain the value in it. User also uses the switch statement for this execution. User ask to enter the number and in switch statement user declare for loop i=2 and <20 any number been entered the increment operator will increase i+1. Case 2 has the same condition increment operator will increase the number i+2. And default case will show the message “enter valid number“. Display the result on the screen as output.

 
by Dinesh Thakur

In this program user ask to convey that how to pass 2d array to a function. User define value in first instance for M=3, N=5. User also declare array type variable for storing the value. User input a message that prints a matrix for and then returns a value. Next move two functions are made for passing array like fstore, fretrieve and the loop statement also declares in the function for varying the condition. Nested loop statement is been implemented for the function. And in the last result is been displayed on the screen.

 
by Dinesh Thakur

In this program user ask to check that how to pass one dimensional Array to function. For this user declares the variable regarding to function. Like fstore, fretrieve, fedit these variables will be handy in criteria of function. User also define N value=5.User asks to enter data for matrix and return that all data. Here user make function for the every step like fstore, fretrieve, fedit that is been used along with loop statement that will vary the condition according to filled data. The all three functions are used for data passing next move the user prints the message for previous data and the symbol for skip or edit the data. Display result in the end for this one.

 
by Dinesh Thakur

This is c program that ask user to find out the Maximum number from given digits. User declares the required variables that use to contain the value in it. User ask to enter any five values then for loop will come in exist for evaluate the condition then if condition will use to evaluate that which number is minimum and which is maximum. Then display the result on screen as output.

 
by Dinesh Thakur

This is C Program Find the Factorial of N Number. This program is for finding the factorial of N number. Two integer type variables declared with static value one of them. Here to user enter the value for finding the factorial. Then loop statement for stepping forward to find the result and (f*I) and at last to print the output on the display.

 
by Dinesh Thakur

This program asks user to define the Goto Command. Goto command is a skip through command in C like if any condition got terminated or false the Goto command skip the process to desired location where it sets for skipping.

 
by Dinesh Thakur

Let us denote the i th term in the Fibonacci series as Fi , where. i is assumed to take values starting form 0. Thus, the first four terms in the Fibonacci series are denoted as F0, F1, F2. and F3. The first two terms are given as F0=O and F1 = 1.

 
by Dinesh Thakur

In this program user convert the temperature from Fahrenheit to Celsius. User declares required variables for containing the value in it. User declares the value to variables manually to make process of temperature conversion. Then while condition for laying the condition complete. In while condition the method is been used for temperature conversion that are required. Then a printing method to print result on the screen.

 
by Dinesh Thakur

This is C Program to Print a Table with While Loop. In this program the User asks to print a table with the use of while loop. While loop checks the condition at least once and after that it goes on. Three variables are declared to containing the value in it for condition falling. User asks to enter the value. Then using of while condition. While (a<=10) then c=b*a. and so on increment operator a++ and printing the result on the screen.

 
by Dinesh Thakur

This program is for finding the factorial of N number. Two integer type variables declared with static value one of them. Here to user enter the value for finding the factorial. Then loop statement for stepping forward to find the result and (f*I) and at last to print the output on the display.

 
by Dinesh Thakur

This program asks the user to find out the prime number. For this user declare the variables that use to store the value in it. User declare two int variables one of them value assign b=2 and put them on a while condition. While (a>1) then passes to control statement if (a%b==0) then a=a/b else b=b+1 and get the output on screen as result. That will show the output is prime numerical or not.

 
by Dinesh Thakur

In this program user ask to find out the average of n Numbers. User declares some variables that are used to contain the value and some elements to be assumed for computation as it is. Like variable N has to be assumed for finding average. While asking about the number quantity user also use While condition to the content. While (count < n) in condition prints the value of x and increment operator for increasing the number. In the end the method to be used for the calculating the average of N number. In the end to display the result in the end.

 
by Dinesh Thakur

In this program user ask to reverse the 10 digit number. To reverse the digit user declares the variables for storing the value in it so far. User asks to put out the 10 digit value on double quoted premises. The after user declare the while condition while (a!=0). Then if the given condition rely on the situation the variable b=a%10. Then after user print out the result on the screen.

 
by Dinesh Thakur

In This program user ask to find out the number is Armstrong or not. “A number is Armstrong if the sum of cubes of individual digits of a number is equal to the number itself”. User declares required variables for this operation. User uses a temp variable that will use to store the value for temporary time period. Declaring while condition while (num>0) user ask to cub=num%10, num=num/10, sum=sum+ (cub*cub*cub).

 
by Dinesh Thakur

This program asks user to replace the occurrence of M by N. user declare variables and some method for replacement of occurrences. Like user ask to put file name here if condition will come in use for checking out the file exist or not if not the message will be “file can’t be open” else the while condition will use in for passing to “EOF”. If the condition match if(ch=='M'||ch=='m') then the process will use method to replace the letter with N from M. display result on the screen at last instance.

 
by Dinesh Thakur

In this program integer type variables declare (vowel,Consonent) and pointer of file (FILE *fp1;). And control statements also used if the given situation is not true than the arguments will be insufficient else it will go on. Nested if statements also come in use the next move is to if file pointer is null then source will not open. While condition tells the (ch!EOF) not equal to End of File. If condition used with the OR (!!) operator. This Will checks out the given characters match the condition. Then it’s Vowel else consonant. And in the last move it will be counted as result.

 
by Dinesh Thakur

In this program user ask to calculate the words in file. User declare the pointer type file variable for value reference. File open function used to open the file for reading the content in file. If condition checks whether the file is null if it is the else condition comes in where while condition checks the logic (ch!=eof). Through else condition the content check to end of file. And then to print the result on display.

 
by Dinesh Thakur

In this program user ask to print out the char of a file along with their positions. As user declare the variables for containing the value in it. Here user pointer type variable declaring then ask to enter the file name. if condition will checks out the has file exist or not if the file not exist the message will be file cant open if it exist the while condition will checks out all the character to EOF. With the method of display all the characters will be counted as output.

 
by Dinesh Thakur

In this program user asks to convert all characters that are contained in a file to uppercase. To make this process user need to make a file and fill up some characters in it for operation. User declares the variables. And then put up a function to open file and also fill up character in it. Then if condition checks whether the file exists or not if the condition goes true then the program will terminate because file does not exist or then after while condition checks out the file and character and put up the condition to convert it into uppercase. Display the result on the screen.

 
by Dinesh Thakur

In this example, a for loop is used to determine the factorial of a given number, a. The variable a itself is used as the loop variable. As the value of variable a will be initialized when the scanf statement is executed, the initial expression in the for loop is not required and is omitted.

 
by Dinesh Thakur

In this Program user asks to Swap a two number through function. User declares the pointer type variable for interchanging the value of two variables. User asks to enter the value. User make a function named swap that will be called in other class. Then a printing message for swapped value to the function then returns a value.

 
by Dinesh Thakur

The strchr function finds the first occurrence of a specified character in a string, If the specified character is found, the function returns a pointer to that character; otherwise, it returns a NULL pointer. Initially, the strchr function is used to locate the position of the first ' l ' character in strings and its address is assigned to pointer result.


 
by Dinesh Thakur

This is C Program Find Sum of Two number Through Function. In this program user asks to find the sum of two numbers with use of function in other words Polymorphism. The function calling procedure will use in this program to find the sum of two numbers. First user ask the numbers which are use to add. Then it declares a function sum (a,b). The next move it call the function sum with formal arguments int x, int y and int z=x+y in this procedure the value call from the upper class but add in other class. And in the last the result print on the screen.

 
by Dinesh Thakur

In this program user asks to find the sum, division, multiply of two numbers with use of function in other words Polymorphism. The function calling procedure will use in this program to find the sum of two numbers. First user asks the numbers which are use to add, divide or multi. Then it declares a function sum, multi, divide (a,b). The next move it call the function sum with formal arguments int x, int y in this procedure the value call from the upper class but add in other class. And in the last the result print on the screen.

 
by Dinesh Thakur

In this program user ask to find out the HCF (highest common factor) using function. As declaring required variable user ask to enter the value. User made a function named “HCF”. Then using control statement if(a>b) the HCF (a,b) else (b,a) after fetching the HCF through getch(). 

 
by Dinesh Thakur

Consider the program given below, written using the top-down approach, that calculates the factorial of a given integer number using function fact defined in Example. Function fact is called in the main function from a printf function call and the int value returned by it is printed using the %d conversion specification.

 
by Dinesh Thakur

 This is C program that asks user to create the bank system criteria through programming. User will use switch statement to create these operation. From this user can select through their choices. User also declares variables for the storing value. User also declares some functions like void creation (), void deposit (), void withdraw (). These function will used during calling operation.

 
by Dinesh Thakur

In this program, a structure (student) is created which contains name,subject and marks as its data member. Then, an array of structure of 10 elements is created. Then, data (name, sub and marks) for 10 elements is asked to user and stored in array of structure. Finally, the data entered by user is displayed.

 
by Dinesh Thakur

In this program user ask to sort the record of multiple students merit wise. In this program structure type variable declared and a temp variable for temporary value storing. User need to establish the merit chart for sorting them. For this process user will use loop statement where user will calculate the data of students that are define on variable value. Loop statement will print all the data about student (roll no,score,name etc.). From the structure type variable.

 
by Dinesh Thakur

 This is C Program to Swap Two Numbers Using Pointer. In this program the two numbers to be swapped from each other place with the use of pointer this concept works on the address reference. In program the variables declare for storing the value in it. Here a variable named ‘temp’ also declared with the use of only two numbers the swapping will happen interference of temp variable the first number shifted to temp 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

In this program user ask to convert a value to pointer check address of variable. User declares some variables for this to contain the value in it. User declare <math.h> header file for math functions like pi etc. the type of variable is differ like some are double, integer, char type etc. user print out the method for conversing in pointer type to using all the method for conversion display the result as output.

 
by Dinesh Thakur

The program implements the Copy string to another string. The inner function “stcpy” takes 2 string pointers as arguments. “copystr” pointer type function declared and pointer type char variable declare. On next move the argument written “I am Dinesh Thakur” in the variable char pointer type and array type string variable. The required function used “cpystr”.

 
by Dinesh Thakur

In this Program pointer concept is been used with the use of variables of pointer type char and integer type which contain the values. Reorder () also used for sorting the the string as required. In the program string is to be entered after that loop statement works. During loop statement the pointer type variable acquires the memory using malloc() function.



 
by Dinesh Thakur

This is C program where user asks to interchange the two values with each other using Call by reference method. Declaring the required variable for functionality. Then after user declare void swap() function that which will give the reference to other class for interchange. After that user call the function that declare void swap() then using method to interchange the value of variables with the help of pointer concept to declare pointer type variables that are useful while using the call by reference method. In the end the result has to be display on the screen.

 
by Dinesh Thakur

In this program user ask to find the Maximum number between the 5 numbers. Here user declares the variables that which store the value. User asks to enter the five numbers for compilation. Here user uses for loop to vary the condition regarding to situation. Here user declare nested loop statement for number and then if condition. If (a[i]>a[j]) if all the condition got vary then the loop statement will collaborate the number that it varies and put on the screen as result it has.

 
by Dinesh Thakur

In this program user ask to convert decimal number into binary number. Binary number has the base of 2. In this program user declare the variable and then the while condition in while condition (n>0). That will manipulated with a[d]=n%2. And then division with 2. Here after the increment operator and for printing out the binary number user uses the loop statement that will generate the binary number on the display.

 
by Dinesh Thakur

This is C program that asks user to find out the highest marks and average of students. Here declaring required variables for storing the value. User declares an array type variable in this user puts the value static up to 10 element. Using clear screen method user also uses the loop statement for vary the condition for average and marks into it. And a control statement also use for getting the condition true. if (mark[i] > highest) then the highest marks will be in mark[i]. 

 

Page 1 of 2