answersLogoWhite

0

Pseudocode display num

Updated: 12/13/2022
User Avatar

Wiki User

13y ago

Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: Pseudocode display num
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Write a pseudocode to find the greatest of two numbers?

Begin read a,b if a>b display a is greater else display b is greater end


How do you display prime number in Microsoft visual studio 6.0?

Function is_prime(ByVal num As Integer) As Boolean If num < 0 Then num = num * -1 If num < 2 Then Return False If num Mod 2 = 0 Then Return num = 2 Dim max As Integer = Math.Sqrt(num) For div As Integer = 3 To max Step 2 If num Mod div = 0 Then Return False Next Return True End Function Sub Main() For num As Integer = 0 To 100 If is_prime(num) Then Console.Write(num) Console.WriteLine(" is prime") End If Next End Sub


What function enables the user to input information while the program is being executed in c?

The scanf() function is a commonly used function to input information during the execution of a program. scanf() function has its prototype in the stdio.h header file. To accept and display a number: int num; printf("Enter a number: "); scanf("%d",&num); printf("You entered %d",num); To accept and display a character, replace %d with %c and make num a character variable [char]. Plus: gets, fgets, read, fread, getchar, getc, fgetc, getch...


How do you write a program to read a value and display all prime numbers up to the value?

#include#includebool is_prime(unsigned num) {unsigned max, factor;if (num


How do you create a string and reverse a string in visual basic?

Dim x As String x = "HELLO" Dim tmpString As String tmpString = Nothing For j = 0 To x.Length - 1 Dim int int=x.Length - 1 int=int-j tmpString=x(j) Next

Related questions

Write a pseudocode to find the greatest of two numbers?

Begin read a,b if a>b display a is greater else display b is greater end


How do you display prime number in Microsoft visual studio 6.0?

Function is_prime(ByVal num As Integer) As Boolean If num < 0 Then num = num * -1 If num < 2 Then Return False If num Mod 2 = 0 Then Return num = 2 Dim max As Integer = Math.Sqrt(num) For div As Integer = 3 To max Step 2 If num Mod div = 0 Then Return False Next Return True End Function Sub Main() For num As Integer = 0 To 100 If is_prime(num) Then Console.Write(num) Console.WriteLine(" is prime") End If Next End Sub


C plus plus program to display even number from 2 to 50?

#include<iostream> int main() { for(int num=2; num<=50; i+=2) std::cout << num << std::endl; return(0); }


What buttons display on-off lights on the keyboard?

num lock, caps lock, scroll lock


Write a pseudo code to display prime numbers from 1-1000?

loop i from 0 to num check if num mod i equals 0breakelsesum = sum + numend the loopprint the sum


How do you write a c program to convert binary code to Gray code?

unsigned binary_to_gray (unsigned num) { return num ^ (num >> 1); } unsigned gray_to_binary (unsigned num) { /* note: assumes num is no more than 32-bits in length */ num ^= (num >> 16); num ^= (num >> 8); num ^= (num >> 4); num ^= (num >> 2); num ^= (num >> 1); return num ; }


What function enables the user to input information while the program is being executed in c?

The scanf() function is a commonly used function to input information during the execution of a program. scanf() function has its prototype in the stdio.h header file. To accept and display a number: int num; printf("Enter a number: "); scanf("%d",&num); printf("You entered %d",num); To accept and display a character, replace %d with %c and make num a character variable [char]. Plus: gets, fgets, read, fread, getchar, getc, fgetc, getch...


Write a program to display table of five in unix?

sum=0 i=1 echo "Enter any number " read num while [ $i -le 10 ] do sum=`expr $num \* $i` i=`expr $i + 1` echo "Table of a number is " $sum done


Cookie monster phrases?

num num num


How do you write a program to read a value and display all prime numbers up to the value?

#include#includebool is_prime(unsigned num) {unsigned max, factor;if (num


How do you convert a number into a degree circle?

In simple Python code: def convertToAngle(num): while True: if num < 0: num = 360 - num elif num > 360: num -= 360 else: break return num


How do you write a program in C plus plus print 1 to 10000 in Roman numerals?

#include<iostream> #include<sstream> #include<exception> std::string decimal_to_roman (unsigned num) { std::stringstream ss {}; while (num>0) { if (num>10000) throw std::range_error ( "ERROR: decimal_to_roman (unsigned num) [num is out of range]"); else if (num==10000) { ss<<"[M]"; num-=10000; } else if (num>=9000) { ss<<"[CM]"; num-=9000; } else if (num>=5000) { ss<<"[D]"; num-=5000; } else if (num>=4000) { ss<<"[CD]"; num-=4000; } else if (num>=1000) { ss<<"M"; num-=1000; } else if (num>=900) { ss<<"CM"; num-=900; } else if (num>=500) { ss<<"D"; num-=500; } else if (num>=400) { ss<<"CD"; num-=400; } else if (num>=100) { ss<<"C"; num-=100; } else if (num>=90) { ss<<"XC"; num-=90; } else if (num>=50) { ss<<"L"; num-=50; } else if (num>=40) { ss<<"XL"; num-=40; } else if (num>=10) { ss<<"X"; num-=10; } else if (num==9) { ss<<"IX"; num-=9; } else if (num>=5) { ss<<"V"; num-=5; } else if (num==4) { ss<<"IV"; num-=4; } else if (num>=1) { ss<<"I"; num-=1; } } return ss.str(); } int main (void) { for (unsigned n=1; n<=10000; ++n) { try { std::cout << n << "\t = " << decimal_to_roman(n) << std::endl; } catch (std::range_error& e) { std::cerr<<e.what()<<std::endl; break; } } }