Noc20-Cs08 Week 01 Assignment 04

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

02/07/2020 Programming in Java - Course

(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)

reviewer4@nptel.iitm.ac.in 

NPTEL (https://swayam.gov.in/explorer?ncCode=NPTEL) » Programming in Java (course)

Announcements (announcements)

About the Course (https://swayam.gov.in/nd1_noc20_cs08/preview) Ask a Question (forum)

Progress (student/home) Mentor (student/mentor)

Java Week 1:Q4


Course Due on 2020-02-13, 23:59 IST
outline
Complete the code segment to check whether the number is an Armstrong number
or not.
How does an
NPTEL online Sample Test Cases
course work? Input Output

Week 0 : Test Case 1 203 0

Week 1 : Test Case 2 0 1

Lecture 01 : Test Case 3 1 1


Introduction
(unit?
unit=2&lesson=15) Test Case 4 153 1

Lecture 02 :
Java The due date for submitting this assignment has passed.
Programming As per our records you have not submitted this assignment.
Steps (unit? Sample solutions (Provided by instructor)
unit=2&lesson=16)
1 import java.util.Scanner;
2 public class Exercise1_4 {
Lecture 03 : 3 public static void main(String[] args) {
Java Tools and 4 Scanner sc = new Scanner(System.in);
Resources 5 int n=sc.nextInt();
6 int result=0;
(unit? 7 int temp=n;
unit=2&lesson=17) 8 int c=0,t;
9 //Use while loop to check the number is Armstrong or not.
Lecture 04 : 10 while(n>0)
11 {
Demonstration- 12 t=n%10;
I (unit? 13 n=n/10;
unit=2&lesson=18) 14 c=c+(t*t*t);
15 }
16 if(temp==c)
Lecture 05 : 17 result=1;
Java Applet 18 else

https://onlinecourses.nptel.ac.in/noc20_cs08/progassignment?name=105 1/3
02/07/2020 Programming in Java - Course

Programming 19 result=0;
(unit? 20 //Evaluation code
21 System.out.println(result);
unit=2&lesson=19) 22 }
23 }
Quiz :
Assignment 1
(assessment?
name=93)

Java Week
1:Q2
(/noc20_cs08/progassignment?
name=102)

Java Week
1:Q3
(/noc20_cs08/progassignment?
name=103)

Java Week
1:Q4
(/noc20_cs08/progassignment?
name=105)

Java Week
1:Q5
(/noc20_cs08/progassignment?
name=106)

Feedback For
Week 1 (unit?
unit=2&lesson=112)

Week 2 :

Week 3 :

Week 4 :

Week 5 :

Week 6 :

Week 7 :

Week 8 :

Week 9 :

Week 10 :

Week 11 :

Week 12 :

DOWNLOAD
VIDEOS

https://onlinecourses.nptel.ac.in/noc20_cs08/progassignment?name=105 2/3
02/07/2020 Programming in Java - Course

Assignment
Solution

Books

Live Interactive
Session

https://onlinecourses.nptel.ac.in/noc20_cs08/progassignment?name=105 3/3

You might also like