answersLogoWhite

0

#include <stdio.h>

#include <conio.h>

#include <math.h>

#include <stdlib.h>

#define p printf

#define s scanf

int ctr,x,n,nmod;

char cont;

main()

{

do

{ clrscr();

ctr=0;

p ("Input a number: ");

s ("%d", &n);

if (n<0) p ("\nINVALID NUMBER");

else if (n==0n==1)

p ("\nNEITHER PRIME NOR COMPOSITE");

else if (n>1)

{ for (x=1; x<=n; x++)

{ nmod=n%x;

if (nmod==0) ctr+=1;

}

if (ctr==2) p ("\nPRIME");

else p ("\nCOMPOSITE");

}

p ("\n\nDo you wish to continue [Y/N]? ");

cont=getche();

}

while (cont=='Y'cont=='y');

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What is another word for primary source?

Unoriginal Source


Labels are a good source of information listing the contents from the lowest percentage to the highest percentage of total content?

true


What are the highest frequency and lowest frequency parts of electro magnetic spectrum?

The highest frequency part of the electromagnetic spectrum is gamma rays, while the lowest frequency part is radio waves. Gamma rays have the shortest wavelengths and highest energy, while radio waves have the longest wavelengths and lowest energy.


In highest to lowest degrees?

For the source and more detailed information concerning this subject, click on the related links section (Types of Degrees) indicated below.


What is Sink and source mode of transistor?

Source mode at output provides safety than sink at output


What is the lowest point of Puerto Rico?

Elevation extremes: lowest point: Caribbean Sea 0 m highest point: Cerro de Punta 1,338 m Definition: This entry includes both the highest point and the lowest point. Source: CIA World Factbook - information is accurate as of December 30, 2010


What is meant by the term source?

usually power source where power comes from logic gates outputs are commonly called source or sink say the power source to the package is positive (VCC is +5) to call the output a source we would use an NPN transistor with the collector connected to +5V the base goes to the logic the emitter is the output terminal the output is the source of +5v sink output would have the emitter grounded base to logic the collector is the output so the output will sink positive voltage to ground A BUFFER usually has two output transistors one for source one for sink and can do either or both


Is projector is an input or output device?

Output. It is taking data out the source (computer etc) and displaying it.


What is the output impedance of a constant voltage source and constant current source?

The output impedance is z= V/I, the ratio of the constant voltage and the constant current source.


How do you preview PHP source output?

The only true form of previewing PHP source output is to run the PHP script in question.


What is the output impedance of common source amplifier circuit?

The output impedance of a common source amplifier circuit is typically high. This is because the common source amplifier uses a resistor to provide biasing, which results in a high output impedance. However, this can be mitigated by using a current source instead of a resistor for biasing.


What is the process for resizing the output of the OBS software while maintaining the source size?

To resize the output of OBS software while maintaining the source size, you can adjust the scaling settings in the software. This allows you to change the size of the output without affecting the original source size.