Write a program to calculate the factorial value of the input number n! Use the incrementation formula ( i++ ) for your solution instead of decrementation formula (i-‐-‐).
Apply the three looping statements for your solutions:
Enter a no. 4 Factorial value is: 24 (The computation is: 1*2*3*4=24)
1st Solution – using for loop
2nd Solution – using while loop
3rd Solution-‐ using do while loop
Write a program that generates and displays the Fibonacci sequences numbers of n (as input). In Fibonacci, the current third number is the sum of two previous numbers. Apply three solutions using the three loop statements: Sample input/output dialogue: Enter a no. 9 Fibonacci series: 1 1 2 3 5 8 13 21 34
1st Solution using for loop
2nd Solution – using while loop
3rd Solution-‐ using do while loop
write a program that calculates the power value of the input base number and exponent number. Apply three solutions using the three looping statements: Sample input/output dialogue Enter base no. 5 Input data Enter exponent no. 3 Second input data Power value: 125 Output value (The computation is: 53 = 5 * 5 * 5 = 125)
1st Solution – using for loop
2nd Solution –using while loop
3rd Solution-‐ using do while loop
Write a program to scan a number n and then output the sum of the squares from1 to n. Thus, if the input is 4, the output should be 30 because:12 + 22 + 32 + 42 1 + 4 + 9 + 16 =30
1st Solution – using for loop
2nd Solution – using while loop
3rd Solution-‐ using do while loop
Write a program to calculate the sum of the sequence no. from 1 to n. Thus if the input is 6, the output should be 21 because: (Apply the three looping statements in your solutions) 1 + 2 + 3 + 4 +5 + 6 = 21
1st Solution – using for loop
2nd Solution – using while loop
3rd Solution-‐ using do while loop
Write a program that reverses the input number n. Formulate an equation to come up with the answer:
(Apply the three loop statements in your solutions) Sample input/output dialogue:
Enter a number: 1238 Input data
Reverse number: 8321 Output value
1st Solution using- for loop
2nd Solution using- while loop
3rd Solution using- do while loop
Write a C# program that has a method named ReadArray. In this method, ask the user to enter names of employees, the program stops taking new names when the user enters the word “quit”. All names must be stored in an array as the user enters them; name the array, empNames. In the ReadArray, call another method named ReverseArray and pass to it, the empNames. The ReverseArray method will reverse the content of empNames. In ReadArray, print the reversed array. In the main method, only call the ReadArray, without passing anything to it. You should demo the pass-by-reference in this question.
Sample run:
Please enter an employee name: Karein
Please enter an employee name: James
Please enter an employee name: Komal
Please enter an employee name: Rohit
Please enter an employee name: quit
The names are:
Rohit
Komal
James
Karen
Car Catalogue System: Develop Car Catalogue System application using C#, .NET. Implements all the checks so that there are no errors when Car is added, removed, updated, searched from catalogue and use File/IO.
apply the for looping statement
Write a program that calculates and produces these two columns sequence numbers using the three looping statements:
Sequence nos. Squared
1 1
2 4
3 9
4 16
5 25
apply the following looping statement : for loop, while loop, and do while loop
Write a program that calculates and produces these two columns sequence numbers using the three looping statements:
Sequence nos. Squared
1 1
2 4
3 9
4 16
5 25
Expert's answer