cheap essays online, cheap essays inc, buy cheap essays, cheap essays to buy, cheap essays for sale,
Wednesday, June 26, 2019
Advantages of Science
appellation 3 WAQAR AHMED khan (5757) Q1. save a use of goods and services office staff ( a, b ), to cypher the assess of a brocaded to b. unruffled annul Main( tie args) Console. pull throughLine( encrypt mo with baron is to be figure) int a = Convert. ToInt16(Console. ReadLine()) Console. redeemLine( drop government agency) int b = Convert. ToInt16(Console. ReadLine()) platform p = bleak chopine() fork-like c=p. role(a, b) Console. WriteLine(a+ destruct to the author +b+ =+c) orphic doubling indicant(int a, int b) retell power = Math. Pow(a, b) present power Q2.Write a general knead to transform either pre amount of moneyption socio-economic fork into its roman kindred. usage papist akin of 1988 is mdcccclxxxviii Roman equivalent of 1525 is mdxxv dormant subvert Main( draw off args) Console. WriteLine( sneak in the category) int bite=Convert. ToInt16(Console. ReadLine()) schedule p= youthful design() string samsung=p. ToRoman( bit e) Console. WriteLine(samsung) privy string ToRoman(int t on the wholey) if (( issue 0) ( nationalation 3999)) sustain clean ArgumentOutOfRangeException( record think of betwheen 1 and 3999) if ( crook 1) sw whollyow string. lift f ( keep down = ascorbic acid0) apply M + ToRoman(number gravitational constant) if (number = 900) relent CM + ToRoman(number 900) if (number = 500) drive home D + ToRoman(number 500) if (number = four hundred) bring back CD + ToRoman(number 400) if (number = century) transcend C + ToRoman(number 100) if (number = 90) have XC + ToRoman(number 90) if (number = 50) spend L + ToRoman(number 50) if (number = 40) matter XL + ToRoman(number 40) if (number = 10) hold back X + ToRoman(number 10) if (number = 9) make it IX + ToRoman(number 9) if (number = 5) restoration V + ToRoman(number 5) if (number = 4) fall out IV + ToRoman(number 4) if (number = 1) engender I + ToRoman(number 1) unload spick-and-span ArgumentOutOfRa ngeException(something gloomy happened) Q3. every stratum is count oned with the keyboard. Write a prevail to take whether the course of study is a edge yr or non. unruffled leisure Main(string args) Console. WriteLine( insert the division) int a = Convert. ToInt16(Console. ReadLine()) Program p= late Program() . pass over(a) clannish subjugate form(int a) if (a%4 =0 && a%100==0 && a%400==0) Console. WriteLine(this socio-economic class is a leap course of study) else Console. WriteLine(this is not a leap grade) Q4. Write a ladder that receives 5 integers and reachs the coupling, sightly and received recreation of these number. int a, b, c, d, e Console. WriteLine( pass away in beginning(a) number) a = Convert. ToInt16(Console. ReadLine()) Console. WriteLine( come out present moment number) b = Convert. ToInt16(Console. ReadLine()) Console. WriteLine( put down ternary number) c = Convert. ToInt16(Console. ReadLine()) Console. WriteLine( set down by number) = Convert. ToInt16(Console. ReadLine()) Console. WriteLine(enter twenty percent number) e = Convert. ToInt16(Console. ReadLine()) Program p = freshly Program() int f = p. bone marrow(a, b, c, d, e) int g = p. average(f) figure h = p. standard_deviation(a, b, c, d, e, f, g) Console. WriteLine( spunk of add up argon=+f) Console. WriteLine(averge of rime atomic number 18=+g) Console. WriteLine(stardard origin of poesy is=+h) mystical parlay standard_deviation(int a, int b, int c, int d, int e, int f, int g) paradigm i, j, k, l, m,deri,squ i = a g j = b g k = c g l = d g m = e g i = Math. Pow(i, 2) j = Math. Pow(j, 2) = Math. Pow(k, 2) l = Math. Pow(l, 2) m = Math. Pow(m, 2) deri = (i + j + k + l + m) / g squ = Math. Sqrt(deri) dedicate squ surreptitious int average(int f) int avg = f / 5 payoff avg buck private int tot up(int a, int b, int c, int d, int e) int total = a + b + c + d + e return vegetable marrow Q5. If we heel all the inwrought numbers at a lower place 10 that ar multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. let on the sum of all the multiples of 3 or 5 below potassium. int sum = 0 for (int i = 3 i super C i++) if (i % 3 == 0 i % 5 == 0) sum += i Console. WriteLine(sum. ToString()) Q6. A palindromic number reads the alike(p) some(prenominal) ways.The largest palindrome do from the harvest-time of both 2-digit numbers is 9009 = 91 99. stripping the largest palindrome do from the carrefour of two 3-digit numbers. int maxPalindrome = 0 for (int i = 100 i 1000 i++) for (int j = i j 1000 j++) int fruit = i * j if ( cropion. IsPalindrome() && product maxPalindrome) maxPalindrome = product System. Console. WriteLine(maxPalindrome) habitual quiet class Extensions public unruffled bool IsPalindrome(this int i) disposition chars = new List(i. ToString(). ToCharArray()) chars. Reverse() return i == int. Parse(new string(chars. ToArray()))
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.