write the program for prime numbers?
Answer Posted / arfu
#include<stdio.h>
int main()
{
int c,i,n;
c=0;
scanf("%d",&a);
for(i=2;i<a;i++)
if (n%i==0)
{
c=1;break;
}
if(c!=1)`("prime");
else printf ("not a prime");
}
| Is This Answer Correct ? | 110 Yes | 89 No |
Post New Answer View All Answers
Describe the difference between = and == symbols in c programming?
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
Explain what is the general form of a c program?
What does c mean in standard form?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
What is uint8 in c?
When should you not use a type cast?
What is int main () in c?
What is a built-in function in C?
What does the && operator do in a program code?
Why is #define used?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
What is nested structure with example?