SOLVE IN C PROGRAMMING LANGUAGE Q # 1. Illustrate your knowledge of C-Programming by implementing following programs: (a). Write a function that takes an integer as input and finds whether it is a prime number or not. Function should return 1 if number is prime, 0 otherwise. In main 0, ask the user to enter the number and call the function. Based upon the value returned by the function, main ) will display on screen, if the number is prime or not. (b). Write a function decimal to binary () that takes an integer value converts it to binary and returns the binary number. In main () ask for an integer from user, call decimal to binary () to convert the number to binary and display the result on screen.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question
Solve in c programming language.
SOLVE IN C PROGRAMMING LANGUAGE
Q # 1.
Illustrate your knowledge of C-Programming by implementing following programs:
(a). Write a function that takes an integer as input and finds whether it is a prime number or
not. Function should return 1 if number is prime, 0 otherwise. In main (), ask the user to enter
the number and call the function. Based upon the value returned by the function, main () will
display on screen, if the number is prime or not.
(b). Write a function decimal to binary () that takes an integer value converts it to binary and
returns the binary number. In main () ask for an integer from user, call decimal to binary 0 to
convert the number to binary and display the result on screen.
Transcribed Image Text:SOLVE IN C PROGRAMMING LANGUAGE Q # 1. Illustrate your knowledge of C-Programming by implementing following programs: (a). Write a function that takes an integer as input and finds whether it is a prime number or not. Function should return 1 if number is prime, 0 otherwise. In main (), ask the user to enter the number and call the function. Based upon the value returned by the function, main () will display on screen, if the number is prime or not. (b). Write a function decimal to binary () that takes an integer value converts it to binary and returns the binary number. In main () ask for an integer from user, call decimal to binary 0 to convert the number to binary and display the result on screen.
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr