Question

In: Computer Science

write pseudocode for the following problems not c code Pseudocode only Write a C program to...

write pseudocode for the following problems not c code

Pseudocode only


Write a C program to print all natural numbers from 1 to n. - using while loop


Write a C program to print all natural numbers in reverse (from n to 1). - using while loop


Write a C program to print all alphabets from a to z. - using while loop


Write a C program to print all even numbers between 1 to 100. - using while loop


Write a C program to print all odd number between 1 to 100.


Write a C program to find sum of all natural numbers between 1 to n.


Write a C program to find sum of all even numbers between 1 to n.


Write a C program to find sum of all odd numbers between 1 to n.


Write a C program to print multiplication table of any number.


Write a C program to count number of digits in a number.


Write a C program to find first and last digit of a number.


Write a C program to find sum of first and last digit of a number.


Write a C program to swap first and last digits of a number.


Write a C program to calculate sum of digits of a number.


Write a C program to calculate product of digits of a number.


Write a C program to enter a number and print its reverse.


Write a C program to check whether a number is palindrome or not.


Write a C program to find frequency of each digit in a given integer.


Write a C program to enter a number and print it in words.


Write a C program to print all ASCII character with their values.


Write a C program to find power of a number using for loop.


Write a C program to find all factors of a number.


Write a C program to calculate factorial of a number.


Write a C program to find HCF (GCD) of two numbers.


Write a C program to find LCM of two numbers.


Write a C program to check whether a number is Prime number or not.


Write a C program to print all Prime numbers between 1 to n.


Write a C program to find sum of all prime numbers between 1 to n.


Write a C program to find all prime factors of a number.


Write a C program to check whether a number is Armstrong number or not.


Write a C program to print all Armstrong numbers between 1 to n.


Write a C program to check whether a number is Perfect number or not.


Write a C program to print all Perfect numbers between 1 to n.


Write a C program to check whether a number is Strong number or not.


Write a C program to print all Strong numbers between 1 to n.


Write a C program to print Fibonacci series up to n terms.


Write a C program to find one's complement of a binary number.


Write a C program to find two's complement of a binary number.


Write a C program to convert Binary to Octal number system.


Write a C program to convert Binary to Decimal number system.


Write a C program to convert Binary to Hexadecimal number system.


Write a C program to convert Octal to Binary number system.


Write a C program to convert Octal to Decimal number system.


Write a C program to convert Octal to Hexadecimal number system.


Write a C program to convert Decimal to Binary number system.


Write a C program to convert Decimal to Octal number system.


Write a C program to convert Decimal to Hexadecimal number system.


Write a C program to convert Hexadecimal to Binary number system.


Write a C program to convert Hexadecimal to Octal number system.


Write a C program to convert Hexadecimal to Decimal number system.


Write a C program to print Pascal triangle upto n rows.


Star pattern programs - Write a C program to print the given star patterns. 


Number pattern programs - Write a C program to print the given number patterns.

Solutions

Expert Solution

1.Write a C program to print all natural numbers from 1 to n. - using while loop?

Pseudocode:

Initialise n

Set i to 1

Input n //input n means user giving n value

while i is less than n

  print i

Add 1 to i //i=i+1

ENDWHILE

2.Write a C program to print all natural numbers in reverse (from n to 1). - using while loop

Pseudocode:

Initialise n

Input n //input n means user giving n value

Set i to n

while i is greater than 0

  print i

Subtract 1 from i //i=i-1

ENDWHILE

3.Write a C program to print all alphabets from a to z. - using while loop

Pseudocode:

Declare alphabet with datatype char

set alphabet to 'a'

while alphabet is less than or equal to 'z'

print alphabet

Add 1 to alphabet //alphabet=alphabet+1

ENDWHILE

4.Write a C program to print all even numbers between 1 to 100. - using while loop

Pseudocode:

set i to 1

while i is less than or equal to 100

IF i %2 is equal to 0

print i

ENDIF

Add 1 to i

ENDWHILE

5.Write a C program to print all odd number between 1 to 100.

Pseudocode:

set i to 1

while i is less than or equal to 100

IF i %2 is notequal to 0

print i

ENDIF

Add 1 to i

ENDWHILE

6.Write a C program to find sum of all natural numbers between 1 to n.

Pseudocode:

Initialise n and sum

Set i to 1

Set sum to 0

Input n //input n means user giving n value

while i is less than n

  add i to sum //sum=sum+i

Add 1 to i //i=i+1

ENDWHILE

print sum

7.Write a C program to find sum of all even numbers between 1 to n.

Pseudocode:

set sum to 0

set i to 1

while i is less than or equal to 100

IF i %2 is equal to 0

Add i to sum //sum=sum+i

ENDIF

Add 1 to i

ENDWHILE

print sum

8.Write a C program to find sum of all odd numbers between 1 to n.

Pseudocode:

set i to 1

set sum to 0

while i is less than or equal to 100

IF i %2 is notequal to 0

Add i to sum

ENDIF

Add 1 to i

ENDWHILE

print sum

9.Write a C program to print multiplication table of any number.

Pseudocode:

input n//taking table number from user

set i to 1

while i is less than or equal to 10

print n,"*",i,"=",n*i

Add 1 to i //i=i+1

ENDWHILE


Related Solutions

Using the pseudocode found below, write only the actual (C++) code for this program. Include all...
Using the pseudocode found below, write only the actual (C++) code for this program. Include all libraries. Specification: Write a program that will repeatedly ask the user for quiz grades in the range from 0 to 20. Any negative value will act as a sentinel. When the sentinel is entered compute the average of the grades entered. Design: Constants None Variables float grade float total = 0 int count = 0 float average ------- Inital Algorithm Repeatedly ask user for...
1. Write pseudocode for the following program. You do not have to write actual C++ code....
1. Write pseudocode for the following program. You do not have to write actual C++ code. Assume you have a text file, that has been encrypted by adding 10 to the ASCII value of each character in the message. Design a decryption program that would reverse this process, and display the original message to the console.to the new array. 2.Write the code for the specified program. Use proper style and naming. Test and upload your code as a CPP file....
C Program and pseudocode for this problem. Write a C program that plays the game of...
C Program and pseudocode for this problem. Write a C program that plays the game of "Guess the number" as the following: Your program choose the number to be guessed by selecting an integer at random in the rang of 1 to 1000. The program then asks the use to guess the number. If the player's guess is incorrect, your program should loop until the player finally gets the number right. Your program keeps telling the player "Too High" or...
Write a C-program to implement the Reader/Writer model for the attached pseudocode modified to produce only...
Write a C-program to implement the Reader/Writer model for the attached pseudocode modified to produce only one million output instead of an infinite amount. Use pthreads and Linux semaphores. Include ten readers with one writer. The writer should produce one million outputs. Verify that the readers receive an equal share of the information produced. Meaning each reader receives about 100,000 of information. Explain your results regardless of the balance. No use mutex or monitor functions. ****PSEUDOCODE**** /* program readersandwriters */...
write pseudocode not c program If- else programming exercises 1.    Write a C program to find...
write pseudocode not c program If- else programming exercises 1.    Write a C program to find maximum between two numbers. 2.    Write a C program to find maximum between three numbers. 3.    Write a C program to check whether a number is negative, positive or zero. 4.    Write a C program to check whether a number is divisible by 5 and 11 or not. 5.    Write a C program to check whether a number is even or odd. 6.    Write...
Using pseudocode or C++ code, write code to print “small” if the magnitude M of an...
Using pseudocode or C++ code, write code to print “small” if the magnitude M of an earthquake is in the range [0, 3), “medium” if M is in the range [3, 6), “large” if M is in the range [6, 9) and “epic” if M is greater than or equal to 9, where M is input by a user via the keyboard. (in c++)
Please write variables and program plan(pseudocode) of this C++ programming code: #include <iostream> using namespace std;...
Please write variables and program plan(pseudocode) of this C++ programming code: #include <iostream> using namespace std; void leapYear(int x); int main() { int x; cout << "Enter a year: "; cin >> x; leapYear (x);   return 0; } void leapYear(int x ) {    if (x % 400 == 0)    {    cout << "This is a leap Year";}    else if    ((x % 4 == 0) && (x % 100 != 0))    {    cout <<...
Need C++ code for following with a document describing the code as well: Write a program...
Need C++ code for following with a document describing the code as well: Write a program to implement the game of Tic Tac Toe Four. The game is played on a 4 × 4 chessboard, within 2 players. The player who is playing "X" always goes first. Players alternate placing Xs and Os on the board until either one player has four in a row, horizontally, vertically, or diagonally; or all 16 squares are filled(which is a draw). The program...
For this assignment you will develop pseudocode and write a C++ program for a simple calculator....
For this assignment you will develop pseudocode and write a C++ program for a simple calculator. You will create both files in Codio. Put your pseudocode and C++ code in the files below. PSEUDOCODE FILE NAME: Calculator.txt C++ SOURCE CODE FILE NAME : Calculator.cpp DESCRIPTION: Write a menu-driven program to perform arithmetic operations and computations on a list of integer input values. Present the user with the following menu. The user will choose a menu option. The program will prompt...
Design (pseudocode) and implement (source code) a program (name it DistinctValues) to display only district values...
Design (pseudocode) and implement (source code) a program (name it DistinctValues) to display only district values in an array. The program main method defines a single-dimensional array of size 10 elements and prompts the user to enter 10 integers to initialize the array. The main method then calls method getValues() that takes an integer array and returns another single-dimensional array containing only distinct values in the original (passed) array. Document your code and properly label the input prompts and the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT