answersLogoWhite

0

What else can I help you with?

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...


write a program that will display one if you enter any number without it will display zero in c?

You can use the following C program to display "1" if a user enters any non-zero number, and "0" if the entered number is zero: #include <stdio.h> int main() { int num; printf("Enter a number: "); scanf("%d", &num); if (num != 0) { printf("1\n"); } else { printf("0\n"); } return 0; } This program reads an integer from the user and checks if it is non-zero or zero, then prints the corresponding output.


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

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 that will display one if you enter any number without it will display zero in c?

You can use the following C program to display "1" if a user enters any non-zero number, and "0" if the entered number is zero: #include <stdio.h> int main() { int num; printf("Enter a number: "); scanf("%d", &num); if (num != 0) { printf("1\n"); } else { printf("0\n"); } return 0; } This program reads an integer from the user and checks if it is non-zero or zero, then prints the corresponding output.


Cookie monster phrases?

num num num


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


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 to read a value and display all prime numbers up to the value?

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