Posts

Deficient Number

Image
Given a number x, your task is to find if this number is Deficient number or not. A number x is said to be Deficient Number if sum of all the divisors of the number denoted by  divisorsSum(x)  is less than twice the value of the number x. And the difference between these two values is called the  deficiency . Mathematically, if below condition holds the number is said to be Deficient: divisorsSum(x)  < 2*x deficiency  = (2*x) - divisorsSum(x) Examples: Input: 21 Output: YES Divisors are 1, 3, 7 and 21. Sum of divisors is 32. This sum is less than 2*21 or 42. Input: 12 Output: NO Input: 17 Output: YES Input: The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each line contains an integer x. Output: For each test case in a new line print 1 if the no is a Deficient number else print 0. Constraints: 1<=T<=10000 1<=x<=10000 Example: Input: 3 21 12 17 Output: 1 0 1 Program: #include<stdio.h>

INTERNET BASICS

Understanding Internet Basics You can program for the Web, using your skills as a Visual Basic programmer, no matter what your level of experience with Internet technology. If you are new to the Internet or unfamiliar with its technology, Visual Basic allows you to quickly and easily produce functional applications. If you are more experienced with Internet technology, you can work at a more advanced level. From one perspective, Internet technology simply provides another area for your development efforts. When you deploy Internet applications on the Web, you may go about it differently — incorporating HTML pages with your Visual Basic code, providing security features, and so on — but you're still calling methods, setting properties, and handling events. In this way, all of your knowledge as a Visual Basic developer can be carried into the Internet arena. From another perspective, applying Internet technology enables you to extend your development skills in exciting ne

JAVA INTRO

Introduction to java Java is an Object-Oriented Language. As a language that has the Object Oriented feature, Java supports the following fundamental concepts: Polymorphism Inheritance Encapsulation Abstraction Classes Objects Instance Method Message Parsing In this chapter, we will look into the concepts Classes and Objects. Object - Objects have states and behaviors. Example: A dog has states - color, name,breed as well as behaviors -wagging, barking, eating. An object is an instance of a class. Class - A class can be defined as a template/blue print that describes the behaviors/statesthat object of its type support. Objects in Java: Let us now look deep into what are objects. If we consider the real-world we can find many objects around us, Cars, Dogs, Humans, etc. All these objects have a state and behavior. If we consider a dog, then its state is - name, breed, color, and the behavior is - barking, wagging, running If you compare the software object with a