Tag Archives: sum

An 8086 assembly language program that finds the sum of 10 consecutive byte values stored in an array in the memory. The result should be stored in AX register – IGNOU MCA Assignment 2017 – 18

MASTER OF COMPUTER APPLICATIONS Course Code : MCSL-017 Course Title : C and Assembly Language Programming (Lab Course) Assignment Number : MCA(1)/L-017/Assignment/17-18 Maximum Marks : 50 Weightage : 25% Write and run (using appropriate calling program) a near procedure in 8086 assembly language that accepts an ASCII value as a parameter in AL register and… Read More »

Write a loop that calculate sum of the n elements of the series 5m Dec2008

Write a loop that calculate sum of the n elements of the series 5m Dec2008 Write a loop that calculate sum of the n elements of the series: 5 1+ 7 +13 +19 + 25 + ……. Write the loop in 3 different ways: (i) using while loop (ii) using do-while loop   #include<stdio.h> void… Read More »

Simplify Boolean function using Karnaugh map method F (A, B, C, D): Σ (0, 2, 4, 5, 6, 7, 8, 10, 13, 15) Also, draw the corresponding logic circuit diagram. 8m Jun2007

Construct the Karnaugh map for the following function, and find the function in sum of product form. Draw the resultant logic diagram. F (A, B, C, D): Σ (0, 2, 4, 5, 6, 7, 8, 10, 13, 15). 5m Dec2007  K-Map for F is: Thus, the simplified equations for F (A, B, C, D) =… Read More »

Write a macro to find the sum of n numbers. 7m Jun2007

Write a macro to find the sum of n numbers. 7m Jun2007 Code: #include<stdio.h> # define SUM(n) ( (n * (n+1)) / 2 ) void main() { int num; clrscr(); printf(” Enter number : “); scanf(“%d”,&num); printf(“\n Sum of n numbers : %d “,SUM(num)); getch(); } [codesyntax lang=”c”] c#include<stdio.h> # define SUM(n) ( (n *… Read More »

Write an algorithm and draw a corresponding flowchart to print the sum of all integers starting from 2 to the given positive integer x where x >= 2. 10m Dec2006

Write an algorithm and draw a corresponding flowchart to print the sum of all integers starting from 2 to the given positive integer x where x >= 2. 10m Dec2006 An algorithm is a finite set of steps defining the solution of a particular problem. An algorithm is expressed in pseudo code – something resembling C language… Read More »

Write an algorithm and draw a corresponding flow chart to print the sum of the digits of a given number

Write an algorithm and draw a corresponding flow chart to print the sum of the digits of a given number 10m Dec2005  An algorithm is a finite set of steps defining the solution of a particular problem. An algorithm is expressed in pseudo code – something resembling C language or Pascal, but with some statements… Read More »

An Assembly Program, which should add two 5-byte numbers (numbers are stored in array- NUM1 & NUM2), and stores the sum in another array named RESULT

Now we will write another Assembly Program, which should add two 5-byte numbers (numbers are stored in array- NUM1 & NUM2), and stores the sum in another array named RESULT. Let’s identify variables needed for this program. First variables will be the one which will hold the values present in the Given Arrays and it… Read More »

ASSEMBLY28 An Assembly program, which takes the input of 4-digit number, and display the sum of square of digits

Now we will write another Assembly program, which takes the input of  4-digit number, and display the sum of square of digits Let’s identify variables needed for this program. First variables will be the one which will hold the value entered by user in the variables D1, D2, D3, D4 to save 4-Digits separately in 4 variables  and variable SUM will hold sum of… Read More »

ASSEMBLY18 An Assembly program to read in decimal inputs repeatedly untill a zero value is read, At this point it should print out the sum of the numbers read in so far

Now we will write another Assembly program to read  in decimal inputs repeatedly untill a zero value is read, At this point it should print out the sum of the numbers read in so far. Let’s identify variables needed for this program. First variables will be holding the Messages “ENTER NO.BETN (0-9) & (ENTER ZERO TO STOP) ” and “TOTAL SUM… Read More »

ASSEMBLY08 An Assembly program to read in two decimal inputs and print out their sum, in decimal

Now we will write another Assembly program to read  two decimal inputs and print out their sum, in decimal Let’s identify variables needed for this program. First variables will be the one which will hold the values present in the variables to be Added and it will be NUM1 and NUM2. Other variable will be holding the Output or Result… Read More »