Sie sind auf Seite 1von 3

Program to find the sum two integers.........4 Program to find the absolute value of an integer........

4 Program to find the absolute value of a real number........4 Program for the setw() command.............4 Program for area of a circle and to understand defining a constant..............5 Program to find the sum of first n natural numbers.....5 Program to find the sum of the squares of the first n natural numbers.............6 Program to find the sum of the odd natural numbers less than or equal to n....................6 Program to find the sum of the even natural numbers less than or equal to n................6 Program to find the sum of the series : 1-2+3-4+........+(1)^(n+1)*n..............7 Program to find the sum of the series : 1-2+34+........+(-1)^(n+1)*n 1-2+3-4+..........+(-1)^(n+1)*n = (1+3+.....upto odd natural number <= n)-(2+4+.....upto even natural number <= n)....7 Program to find the outputs of some expressions having relational operators : >, <, >=, <=, ==, !=...........8 Program to understand the increment operator (prefix/postfix)...........8 Program to understand the decrement operator (prefix/postfix).Increment and decrement operators works on both integer and floating point numbers............9 Program to find the outputs of some expressions having increment...............9 or decrement operators or both Program for remainder operator.......10 Program to find the factorial of an integer......10 Program to find the sum of first n natural numbers using while loop.................11 Program to find the sum of first n natural numbers using do-while loop.................11 Program to find the factorial of an integer using for loop..................11 Program to find the sum of : 1+x+x^2+x^3+x^4+x^5.......12 Program to find the sum : 1+(1/2!)+...+(1/n!)........12

Program to find the sum : 1+(x/1!)+(x^2/2!)+...+(x^n/n!)....12 Program to find exp(x), taking upto the terms > AC=0.00005.................13 Program to swap the values of two variables using temporary variable.............13 Program to find HCF and LCM of two integers.....14 Program to convert a decimal number to binary equivalent...14 Program to convert a decimal number to equivalent binary number...............15 Program to enter an integer until it is divisible by 3..15 Program to swap the values of two variables without using a temporary variable.............16 Program to display an integer e.g 123 as 1,2,3.......16 Program to reverse an integer e.g 123 as 321.......16 Program to check whether an integer is even or odd.....17 Program to find the maximum of n numbers.......17 Program to check for primality of an integer.......17 Program to check the primality of an integer.........18 Program to find the sum of squares of n natural numbers using array.............18 Program to find the sum of squares of n natural numbers using array............19 Program to find the H.C.F of n numbers...........19 Program to find the H.C.F and L.C.M of two numbers using dowhile loop.............20 Program to find the sum of squares of n natural numbers using array...................20 Program to find the sum of 1^2-2^2+3^2-....-10^2 using array...................20 Program to find the maximum of n numbers using array..21 Program to find the minimum of n numbers using array...21 Program to arrange the elements of an array of n numbers in descending order..............22 Program to arrange the elements of an array of n numbers in ascending order..............22 Program to arrange the elements of an array of n numbers in ascending order...............23 Program to arrange the elements of an array of n numbers in descending order..........23 Program to reverse the elements of an array of n numbers without using an another array...........24 Program to reverse the elements of an array of n numbers using an another array...........24 Program to define and access a structure variable....25 Program to add two distances using structure variable...25 Program to define a structure variable for date....26 Program to define a structure for complex numbers and to perform the operations :(1) addition, (2) multiplication, (3) division and (4) print................26 Program to store a 2D array and print the same......27 Program to add two matrices...............27

Program to multiply two matrices..........28 Program to multiply a scalar to a matrix.............29 Program to find the sum of the principle diagonal, upper principal diagonal, lower principal diagonal, cross diagonal elements of a square matrix.............30 Program to produce an identity matrix....................31

Das könnte Ihnen auch gefallen