answersLogoWhite

0

import java.io.InputStreamReader;

import java.io.BufferedReader;

public class Sum

{

static int i;

static int j;

static int sum;

public static void main(String args[])

{

try

{

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

System.out.println("enter first no.");

i=Integer.parseInt(br.readLine());

System.out.println("enter second no.");

j=Integer.parseInt(br.readLine());

sum=i+j;

System.out.println("sum of both no is:="+sum);

}

catch(Exception e)

{

System.out.println("Exception is:-"+e);

}

}

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

What chip of a CPU reads program instructions?

The instruction register.


Write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student?

write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student.


Write a c program that reads ten integers and prints the first and the last numbers on one line and second and ninth on one line and so on....?

#include <cstdio> int main() { int x[10]; printf("Enter 10 integers: \n"); for(int i = 0; i < 10; i++) { scanf("%d", &x[i]); } for(int i = 0; i < 10; i++) { printf("%d, ", x[i]); } char wait; scanf("%s", wait); return 0; }


Write a Java Program that reads a line of integers and then displays each integer and the sum of all the integers Use StringTokenizer class of javautil?

// Get input BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String input = in.readLine(); in.close(); // Parse input int sum = 0; StringTokenizer parser = new StringTokenizer(input); while (parser.hasMoreTokens()) { int currentInt = Integer.parseInt(parser.nextToken()); System.out.println(currentInt); sum += currentInt; } System.out.println("sum = " + sum);


Write a program that read phrase and print the number of lower-case letter in it using function of counting?

write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program

Related Questions

Write is the pseudo code that reads two numbers and multiplies them together and print out their product?

Certainly! Here's a simple pseudocode snippet that reads two numbers, multiplies them together, and prints out their product: 1. Read firstNumber 2. Read secondNumber 3. product = firstNumber * secondNumber 4. Print product In this pseudocode, we first read the two numbers, then multiply them to calculate the product, and finally print out the result.


What is the program that reads and converts the entire program into object code called?

A compiler.


Is there a program that reads text from pictures?

yes possible


What chip of a CPU reads program instructions?

The instruction register.


What is a translation software that reads and excutes one program line at a time?

Interpreter


What is the thing that reads what you type?

It is WordQ. It is a program that you buy to install on your computer and you use Microsoft word or any other typing program to get it to read what you typed.


What happens when a program is launched from a command prompt or from the desktop?

The user interface interprets the command and passes the program name to the file system, which reads the directory.


Write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student?

write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student.


Write a c program that reads ten integers and prints the first and the last numbers on one line and second and ninth on one line and so on....?

#include <cstdio> int main() { int x[10]; printf("Enter 10 integers: \n"); for(int i = 0; i < 10; i++) { scanf("%d", &x[i]); } for(int i = 0; i < 10; i++) { printf("%d, ", x[i]); } char wait; scanf("%s", wait); return 0; }


You bought a 1080p tv but when you hook it up it reads 720pis this normal?

It depends on the program source and what format it's using. The TV's only displaying the information it reads from the incoming signal.


Write a Java Program that reads a line of integers and then displays each integer and the sum of all the integers Use StringTokenizer class of javautil?

// Get input BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String input = in.readLine(); in.close(); // Parse input int sum = 0; StringTokenizer parser = new StringTokenizer(input); while (parser.hasMoreTokens()) { int currentInt = Integer.parseInt(parser.nextToken()); System.out.println(currentInt); sum += currentInt; } System.out.println("sum = " + sum);


In the Windows 2000XP boot process what program reads and loads the boot menu?

ntldr (NT Loader)