Notification texts go here Contact Us Buy Now!
nptel

Write a program that given the digits of two numbers A and B prints out the digits of the sum. The first input is N, the number of digits in A as well as B. After this, the digits of A and B will be given one by one from least significant to the most significant. Your program should print the ith digit of the sum before reading the (i+1)th digit of A and B. You should print N+1 digits for the sum, where the most significant digit can be 0. The length N of the numbers can be large, so in general it won’t be possible to store A or B in the “int” or “long long” data type. Your program should mimic the manual addition process you learned in primary school, i.e. add digits consecutively together with the carry if any, with initially there being no carry. Note that if a computer has to do arithmetic on numbers with hundreds of digits, it will be done in the manner of your program.

Write a program that given the digits of two numbers A and B prints out the digits of the sum.    The first input is N, the number of digits in A a…

Complete the code segment to call the method print() of class given class Printer to print the following.

Complete the code segment to call the method  print() of class given class Printer to print the following. -------------------------------- Hi! I a…

Complete the code segment to call the method print() of class Student first and then call print() method of class School

// This is the class named School class School {      // This is a method in class School     public void print() {  System.out.println("Hi!…

Complete the code segment to help Ragav , find the highest mark and average mark secured by him in "s" number of subjects.

import java.util.Scanner; public class Exercise1_5{     public static void main(String[] args) { Scanner input = new Scanner(System.in);         …

Complete the code segment to check whether the number is an Armstrong number or not. Armstrong Number:

Complete the code segment to  check whether the number is an Armstrong number or not. Armstrong Number: A positive number is called an Armstrong nu…

Consider First n even numbers starting from zero(0).Complete the code segment to calculate sum of all the numbers divisible by 3 from 0 to n. Print the sum.

import java.util.Scanner; public class Exercise1_3 {        public static void main(String[] args) {    Scanner sc = new Scanner(System.in);    …

Complete the code segment to find the largest among three numbers x y and z You should use if-then-else construct in Java

Complete the code segment to find the largest among three numbers x y and z  You should use if-then-else construct in Java import java.util.Scanner; …

Complete the code segment to find the perimeter and area of a circle given a value of radius. You should use Math.PI constant in your program. If radius is zero or less than zero then print " please enter non zero positive number ".

import java.util.Scanner;   public class Exercise1_1 {        public static void main(String[] args) { Scanner s = new Scanner(System.in);         d…
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.