answersLogoWhite

0

Public int Mul(int number)... c

Updated: 12/24/2022
User Avatar

Wiki User

7y ago

Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: Public int Mul(int number)... c
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Write an algorithm to find the greatest number out of the gioven four numbers?

In C#: int[] list = new int[] { 1 , 2, 3, 4}; int highest = int.MinValue; foreach(int i in list) { if(i > highest) { highest = i; } } Console.WriteLine(highest.ToString() + " is the highest number");


How do you write a Program in java to check whether it is a smith number or not?

import java.io.*;class MagicNumber{public int divide(int x){int a,b=0;for(int i=x;i>0;i/=10){a=i%10;b+=a;}return b;}protected static void main()throws IOException{BufferedReader in=new BufferedReader(new InputStreamReader(System.in));System.out.print("Enter the number: ");int a =Integer.parseInt(in.readLine()),b=0,x=1;MagicNumber l=new MagicNumber();do{if(x==1){b=l.divide(a); x++;}else{b=l.divide(b);}}while((b/10)>0);if(b==1)System.out.print("Magic Number!!!!!");elseSystem.out.print("Not a Magic Number!!!!!");}}


Write c sharp program to find sum of two numbers?

public int findSum(int n1, int n2) { return n1 + n2; }


Program to make frequency count of words in a given text?

class Count { public static void main(String args[]) { int i,c=0; int n=args.length; System.out.println("length is"+n); for(i=0;i<args.length;i++) { System.out.println(args[i]); c++; } System.out.println("number of words="+c); } }


Write a java program to generate the Fibonacci Series using for loop?

class Fibonacci { public static void main(String args[]) { System.out.println("enter the number upto u want"); int number=Integer.parseInt(args[0]); int a=0,b=1,c=0; System.out.print(a+" "+b); for(int i=1;i<=number;i++) { c=a+b; System.out.print(c+" "); a=b; b=c; } } } the number are given to the run time where are print the series eg: 5 0 1 1 2 3 5 8 13................

Related questions

Write algorithm of a largest number and smallest number among three numbers?

public class FindLeastAndGreatest { public static void main(String[] args) { // number can't be equal with each other int a = 7; int b = 7; int c = 6; System.out.println(least(a,b,c)); System.out.println(greatest(a,b,c)); } public static int least(int a, int b, int c) { int least = 0; if(a < b && a < c) { least = a; } else if(b < a && b < c) { least = b; } else { least = c;} return least; } public static int greatest(int a, int b, int c) { int greatest = 0; if(a > b && a > c) { greatest = a; } else if(b > a && b > c) { greatest = b; } else { greatest = c;} return greatest; } }


Write an algorithm to find the greatest number out of the gioven four numbers?

In C#: int[] list = new int[] { 1 , 2, 3, 4}; int highest = int.MinValue; foreach(int i in list) { if(i > highest) { highest = i; } } Console.WriteLine(highest.ToString() + " is the highest number");


How do you write a Program in java to check whether it is a smith number or not?

import java.io.*;class MagicNumber{public int divide(int x){int a,b=0;for(int i=x;i>0;i/=10){a=i%10;b+=a;}return b;}protected static void main()throws IOException{BufferedReader in=new BufferedReader(new InputStreamReader(System.in));System.out.print("Enter the number: ");int a =Integer.parseInt(in.readLine()),b=0,x=1;MagicNumber l=new MagicNumber();do{if(x==1){b=l.divide(a); x++;}else{b=l.divide(b);}}while((b/10)>0);if(b==1)System.out.print("Magic Number!!!!!");elseSystem.out.print("Not a Magic Number!!!!!");}}


How do you write a java program to check a number is twisted prime or not?

public class TwistedPrime { public static void main(int n)//Enter a number { int num,s=0,c=0,d; num=n; while(n>0) { d=n%10; s=s*10+d; n=n/10; { for(int i=1;i<s;i++) { if(s%i==0) c++; } } } if(c==1) System.out.print("Number is Twisted Prime"); else System.out.print("Number is not T.P."); } }


How a function can be called in C Sharp?

C# function or a method can be called as described below: -Public class myClass{int num;public myClass(int n){num=n;}public int returnSquare(){return num*num;}}Public class startUpClass{Public static void Main(StringArgs ar){myClass obj=new myClass(12);int result=obj.returnSquare();}}


Write c sharp program to find sum of two numbers?

public int findSum(int n1, int n2) { return n1 + n2; }


Write a c plus plus program to find largest among three number using control statement and ternary operators?

int max (int a, int b) { return a<b?b:a; } int max3 (int a, int b, int c) { return max (max (a, b), c); }


Program to make frequency count of words in a given text?

class Count { public static void main(String args[]) { int i,c=0; int n=args.length; System.out.println("length is"+n); for(i=0;i<args.length;i++) { System.out.println(args[i]); c++; } System.out.println("number of words="+c); } }


Can an instance of class C be obtained as a result of operator overloading where NONE of the operands in the operator functions are of type C?

Yes, it is possible to do this. Consider the following example that returns an instance of class C from the sum of two instances of class A. #include <iostream> class A { public: A(int i=0):m_data(i){} int m_data; }; class C { public: C(int i=0):m_data(i){} int m_data; }; C operator+(const A&a,const A&b) { return(C(a.m_data+b.m_data)); } int main( void ) { A a(5); A b(6); C c=a+b; std::cout<<"c.m_data="<<c.m_data<<std::endl; return(0); }


Write a java program to generate the Fibonacci Series using for loop?

class Fibonacci { public static void main(String args[]) { System.out.println("enter the number upto u want"); int number=Integer.parseInt(args[0]); int a=0,b=1,c=0; System.out.print(a+" "+b); for(int i=1;i<=number;i++) { c=a+b; System.out.print(c+" "); a=b; b=c; } } } the number are given to the run time where are print the series eg: 5 0 1 1 2 3 5 8 13................


Prints the 1000th prime number?

// Print prime number series. class prime { void main () { int i = 1; int C = 0; int n = 1; int X = 0; while (X != 1000) { if ( n % i n ) { C = 0; n++ ; i = 0; } } i++ ; } } }


How do you write a menu-driven Program in java to check a perfect and palindrane number?

import java.io.*;class PerfectPalindrome{private boolean per(int a){int b=0,c=1;for(;c0;b/=10){int d=b%10;c=(c*10)+d;}if(c==a)return true;elsereturn false;}public static void main()throws IOException{BufferedReader in=new BufferedReader(new InputStreamReader(System.in));System.out.println("1. Find a number is a perfect one or not !");System.out.println("2. Find a number is a palindrome or not !");System.out.print("\nEnter your Choice: ");int a=Integer.parseInt(in.readLine()),c;System.out.print("Enter the Number: ");c=Integer.parseInt(in.readLine());boolean b;PerfectPalindrome e=new PerfectPalindrome();switch(a){case 1: b=e.per(c);if(b==true)System.out.print("It is a Perfect Number !");elseSystem.out.print("It is not a Perfect Number !");break;case 2: b=e.pal(c);if(b==true)System.out.print("It is a Palindrome Number !");elseSystem.out.print("It is not a Palindrome Number !");break;default: System.out.print("SORRY!! Wrong Choice!");