write an assembly language program to find sum of N numbers
printf("%s",per>50?:"pass",per<50?:"fail");
int sum = 0; int n = 0; while( sum <= 999 ) { sum += (++n); }
Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11
no thanks
Did you know that memory allocation is not needed to display the matrix? However, the C program is to find the sum of all the elements.
Writing a program for a sum of sine series requires a rather long formula. That formula is: #include #include #include main() { int i,n,x; .
In Java:sum = 0;for (i = 2; i
Since there is an infinite set of prime numbers the answer would be infinity.
for(int i = 1; i < 100; i+=2) { System.out.println(i); }
C Examples on Matrix OperationsA matrix is a rectangular array of numbers or symbols arranged in rows and columns. The following section contains a list of C programs which perform the operations of Addition, Subtraction and Multiplication on the 2 matrices. The section also deals with evaluating the transpose of a given matrix. The transpose of a matrix is the interchange of rows and columns.The section also has programs on finding the trace of 2 matrices, calculating the sum and difference of two matrices. It also has a C program which is used to perform multiplication of a matrix using recursion.C Program to Calculate the Addition or Subtraction & Trace of 2 MatricesC Program to Find the Transpose of a given MatrixC Program to Compute the Product of Two MatricesC Program to Calculate the Sum & Difference of the MatricesC Program to Perform Matrix Multiplication using Recursion
program SumAndDifference; var num1, num2, sum, difference: integer; begin write('Enter first number: '); read(num1); write('Enter second number: '); read(num2); sum := num1 + num2; difference := num1 - num2; if sum > difference then written('The sum is greater: ', sum) else written('The difference is greater: ', difference); end. This program will prompt the user to enter two numbers, calculate their sum and difference, and then compare the two values. If the sum is greater than the difference, it will display the sum; otherwise, it will display the difference.