UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How do I write a prime program in C?

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

Tutor

u can iterate to till the half of the number so that the number of iterations are less...because anyways over half of number it cant be divisible by it...e.g if we cansider number as 18..THE MAX NUMBER IT CAN BE DIVISIBLE WITH IS 9.not more than that
Comments

Computer Wizard. Tutor

void main() { int n,i, count=1; printf ("Enter a number which is greater than one \n"); scanf ("%d",&n); for(i =2; i
Comments

Tutor

void main() { int n,i,p=0,flag=0; clrscr(); printf("Enter the number to check prime:"); scanf("%d",&n); p=n/2; for(i=2;i<=p;i++) { if(n%i==0) { printf("Number is not prime"); flag=1; break; } } if(flag==0) printf("Number is prime"); getch(); }
Comments

View 1 more Answers

Related Questions

What are the functions in C programming?
Functions in C are the basic building blocks of a C program. A function is a set of statements enclosed within curly brackets ({}) that take inputs, do the computation, and provide the resultant output....
Kiran
0 0
6
What is the use of header files in C language?
In summary, header files in C serve as a means of organizing code, providing function prototypes and shared declarations, promoting modularity, and facilitating code reuse. They are essential in large...
Kamal
0 0
6
How do you list a file's date and time?
The C date and time operations are defined in the time.h header file time_t current_time; char* c_time_string; /* Obtain current time. */ current_time = time(NULL);
Neelima
0 0
6
Is it necessary for a programmer to start his career by learning the C language first?
no, but c is the basic if u have good analysing skills need to learn if u learn c , you can easy to get the c++ else u have put some effort on this session f c++
Shilpa

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Basic Concepts of Web Designing
An introduction to domain names, web servers, and website hosting 1)What is the web? In a nutshell, the web is a whole bunch of interconnected computers talking to one another. The computers (on the...

C and C++ programming with memory level debugging
Understanding C and C++ programming by using memory level debugging. Step 1: Understand the Memory map of C executable Step 2: Start memory level debugging using popular IDE Step 3: Find the memory...

Some interview questions and answers for fresher level on Pointers
What is a void pointer? Void pointer is a special type of pointer which can reference or point to any data type. This is why it is also called as Generic Pointer. As a void pointer can point to...

Why C is a Language and not a database?
When I interviewed a candidate, I raised this question many times, but I have not got the answer correctly. To under why C is a language and not a database, it is good to understand why our communication...

Tress And Its Traversal
Depth First Traversals:(a) Inorder (Left, Root, Right) : 4 2 5 1 3(b) Preorder (Root, Left, Right) : 1 2 4 5 3(c) Postorder (Left, Right, Root) : 4 5 2 3 1 Trees are one of the data structures like...

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more