Posts

Showing posts from July, 2012

Arithmatic Operation

Write and run a program that reads a six digit integer and prints the sum of its six digits. Use the quotient operator(/) and the remainder operator(%) to extract the digit from the integer. For example, if N is the integer 876543 then n/1000%10 is its thousands digit 6. << Go to Index Page >>

Conditional Expression

Write and run a program that reads two integers and then uses the conditional expression operator to print either "Multiple" or "Not" according to whether one of the integers is a multiple of the other. << Go to Index Page >>

Comparison Operator

Write and run a program that reads the users age and then prints "You are a Child" if the age < 18, " You are an adult." if 18<=age<65, and "You are a senior citizen." if age >=65. << Go to Index Page >>

Array programming

Write a C Program to fill up an Integer Array. The length of the array must take from the terminal. After fill up the array do the following operations. i)                     Print the array with label formatting. ii)                    Count the number of values inside the array. iii)                  Count the number of odd values. iv)                  Count the number of even values. v)                   Sum all the odd values. vi)                  Sum all the even values. vii)                Calculate the average. viii)               Find the largest value. ix)                  Find the smallest value. << Go to Index Page >>

Find the highest (maximum) and lowest (minimum) grades in an array of 25 integer grades. Print the array and print the highest and lowest grades, labeled appropriately

Task:  Find the highest (maximum) and lowest (minimum) grades in an array of 25 integer grades.  Print the array and print the highest and lowest grades, labeled appropriately. Try to enter all kind of integer grades in your array. Hits of integer grades: A+ is a Letter Grade. A is  a Letter Grade. 4 is an Integer Grade. 3.75 is an Integer Grade. So we may assume that 'A+' = 4, A = 3.75 etc. Source Code #include<stdio.h> #include<conio.h> void grade(float grades[],int size) { float min=0,max=0; int i; for(i=0;imax) { max=grades[i]; } } for(i=0;i<size;i++) { if(grades[i]<min) { min=grades[i]; } } printf("\n"); printf("Maximum Grade: %.2f",max); printf("\n"); printf("Minimum Grade: %.2f",min); } int main() { float grades[25],size; printf("Enter the size of an Array:\n"); scanf("%f",&size); printf("Enter the Grade point:\n"); grade(grades,size);

Write a C program to find the Simple Interest. Take input for principle amount, rate of interest and time from terminal

Simple Interest is the money paid by the borrower to the lender, based on the Principle Amount, Interest Rate and the Time Period. Simple Interest is calculated by, SI= P * T * R / 100 formula. Where, P is the Principle Amount. T is the Time Period. R is the Interest Rate. Definition of 'Simple Interest' from WEB A quick method of calculating the interest charge on a loan. Simple interest is determined by multiplying the interest rate by the principal by the number of periods. Simple Interest = P x I x N Where: P is the loan amount I is the interest rate N  is the duration of the loan, using number of periods Explanation of 'Simple Interest' Simple interest is called simple because it ignores the effects of compounding. The interest charge is always based on the original principal, so interest on interest is not included.  This method may be used to find the interest charge for short-term loans, where ignoring compounding is less of an iss