--THE SUM OF TWO NUMBERS:
declare
a number(2);
b number(2);
c number(2);
begin
a:=&a;
b:=&b;
c:=a+b;
dbms_output.put_line(a ' + 'b' = 'c);
end;
Chat with our AI personalities
#include<iostream.h> #include<conio.h> void main() { int a, b, c; clrscr(); cout<<"enter the two numbers"; cin>>a; cin>b; c=a+b; cout<<"Addition of two numbers="<<c; getch(); }
package AddNumbers; public class AddNumbers { public static void main(String[] args) { int Int; int a = 4; int b=5 ; int sum = a + b; System.out.println("Addition of two numbers!"); System.out.println("Sum: " + sum); } }
Logical errors :- These errors occur because of logically incorrect instructions in the program. Let us assume that in a 1000 line program, if there should be an instruction, which multiplies two numbers and is wrongly written to perform addition. This logically incorrect instruction may produce wrong results. Detecting such errors are difficult.
It is used for addition - to add two numbers. Also, to concatenate two Strings (texts) - that is, to make a longer text from two shorter ones.
The simple Assembly Programs: mov ax,15 mov bx,45 add ax,bx int 21 This is a simple Assembley programs that perform addition of two numbers like 15,45 in above example