by Dinesh Thakur Category: C Programming (Pratical)

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 Category: C Programming (Pratical)

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 Category: C Programming (Pratical)

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 Category: C Programming (Pratical)

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 Category: C Programming (Pratical)

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 Category: C Programming (Pratical)

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 Category: C Programming (Pratical)

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 Category: C Programming (Pratical)

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 Category: C Programming (Pratical)

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 Category: C Programming (Pratical)

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.

 

Page 6 of 18



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.