Question about Computers & Internet

1 Answer

C# code wite a program to accept a number from the user and display all the prime numbers fro zero up to the numbers entered by user?

Write a program to accept a number from the user and display all the prime numbers fro zero up to the numbers entered by user?

Posted by on

Ad

1 Answer

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that gotĀ 5 achievements.

    Sniper:

    An expert who has posted more than 50 answers, of which 90% or more were rated as helpful.

    Governor:

    An expert whose answer gotĀ voted for 20 times.

  • Expert
  • 68 Answers

#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,rem,prime,primchk=1,chk;
clrscr();
printf("\nEnter the limit\n");
scanf("%d",&n);
printf("\n\n\nThe prime numbers are\n");
printf("\n2\t3\t");
for(primchk=1;primchk<=n;primchk++)
{
for(i=2;i<primchk;i++)
{
if(primchk%i==0)
{
chk=1;
chk=0;
break;
}
if(i==primchk-1)
{
if(chk==0)
{
printf("%d\t",primchk);
chk=0;
}
}
}
}
getch();
}

Posted on May 21, 2009

Ad

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya Technician can help you resolve that issue over the phone in a minute or two.
Best thing about this new service is that you are never placed on hold and get to talk to real repair professionals here in the US.
click here to Talk to a Technician (only for users in the US for now) and get all the help you need.
Goodluck!

Posted on Jan 02, 2017

Ad

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

4 Answers

I want to change the dialing number on my allegro GE security system, part no. 60-874-95R. Can you help with this without the vendor's help? Thanks


Follow the instruction on the install manual, page 7. you should start by cleaning the memory of all the previous data - as explained in page 6.
If you don't have the manual get it from here
http://download.homesecuritystore.com/downloadmanual.aspx?FileName=ALLEGRO_Install.pdf

Sep 07, 2011 | Allegro Ge Iti Allegro 80-795 / 60-879-95r...

Tip

Nokia Tips


`Your Nokia cell phone can be programmed to pick up radar speed traps, when programmed your cell phone picks up the radar and alerts you on the message alert tone. 1. Enter your menu 2. Select settings 3. Select security settings 4. Select closed user group 5. Select on 6. Enter 00000 7. Press ok 8. Clear back to normal, within a few seconds your phone will display a radar sign with five zero's next to it. It is now activated. Unfortunately only Nokia phones have this function. Cell info display needs to be de-activated. Settings -> Phone Settings -> Cell Info display Each time you turn off your phone, or even each time you loose contact with your carrier, you´ll have to activate it again... It is done by steps 1 through 5, but the number (00000) will be already on the field as default. If you put the number 500 in the closed user group, and you go out of a store with detection ports thy will go off. Firmware version: *#0000# *#51x0# or *#9999# View Serial No., Date Made, Programming Date, Repaired: *#92772689# Thanks to Ben-Dov for this code IMEI (International Mobile Equipment Identity) Code: *#06# Enhanced Full Rate (EFR): *3370# to activate EFR. Makes calls sound better, but decreases battery life by about 5%. #3370# to deactivate EFR Half Rate Mode (HFR): *4720# to activate HFR. Decreases call quality but increases battery life by about 30%. #4270# to deactivate HFR. Default Security Code: 12345 Warranty Code: *#92702689# [*#war0anty#] asks warranty code. You can then type a number of codes (Thanks to Mike Pfaff for these codes): 6232 - Display date of manufacture 7332 - Display date of last repair 7832 - Display purchasing date 9268 - Display serial number 37832 - Set purchasing date to MMYY 87267 - Confirm Transfer, Related to firmware upgrades #746025625# says SIM CLOCK STOP ALLOWED or similar, depending on your SIM card. Newer SIMs have a feature called 'clock stopping' that allows the phone to save energy -- it is a kind of sleep mode for SIM cards. Not all versions of software support this. You cannot turn the SIM clock on and off, the phone will do it automatically if the SIM supports clock stopping.

on May 20, 2010 | Cell Phones

Tip

Nokia


`Your Nokia cell phone can be programmed to pick up radar speed traps, when programmed your cell phone picks up the radar and alerts you on the message alert tone.

1. Enter your menu
2. Select settings
3. Select security settings
4. Select closed user group
5. Select on
6. Enter 00000
7. Press ok
8. Clear back to normal, within a few seconds your phone will display a radar sign with five zero's next to it. It is now activated.

Unfortunately only Nokia phones have this function. Cell info display needs to be de-activated. Settings -> Phone Settings -> Cell Info display
Each time you turn off your phone, or even each time you loose contact with your carrier, you´ll have to activate it again... It is done by steps 1 through 5, but the number (00000) will be already on the field as default. If you put the number 500 in the closed user group, and you go out of a store with detection ports thy will go off.

Firmware version:
*#0000#
*#51x0# or
*#9999#
View Serial No., Date Made, Programming Date, Repaired:
*#92772689#
Thanks to Ben-Dov for this code
IMEI (International Mobile Equipment Identity) Code:
*#06#
Enhanced Full Rate (EFR):
*3370# to activate EFR. Makes calls sound better, but decreases battery life by about 5%.
#3370# to deactivate EFR
Half Rate Mode (HFR):
*4720# to activate HFR. Decreases call quality but increases battery life by about 30%.
#4270# to deactivate HFR.
Default Security Code:
12345
Warranty Code:
*#92702689# [*#war0anty#] asks warranty code. You can then type a number of codes (Thanks to Mike Pfaff for these codes):
6232 - Display date of manufacture
7332 - Display date of last repair
7832 - Display purchasing date
9268 - Display serial number
37832 - Set purchasing date to MMYY
87267 - Confirm Transfer, Related to firmware upgrades
#746025625# says SIM CLOCK STOP ALLOWED or similar, depending on your SIM card. Newer SIMs have a feature called 'clock stopping' that allows the phone to save energy -- it is a kind of sleep mode for SIM cards. Not all versions of software support this. You cannot turn the SIM clock on and off, the phone will do it automatically if the SIM supports clock stopping.

on Dec 09, 2009 | Cell Phones

3 Answers

How do i reprogram my speeddial numbers on jazz 4400?


Hello.

From NorStar Support:

To Program Personal Speed Dial Numbers: (Numbers 71 - 94 only.
1. Press the Feature button, then * 4
2. Enter the 2 digit code (71 - 94). that you want to assign to that phone number
3. Enter the telephone number, then press the OK softkey
4. Display will show: "Entry xx stored"

If the above doesn't work, try:

To Program Personal Speed Dial Numbers:
  1. Press [Feature] [*] [4]
  2. Enter a two-digit code from 71 to 94.
  3. Specify the external line by pressing a line button, a line pool button, or the intercom button. If you don't specify the external line, the system automatically chooses a line for the call.
  4. Dial the telephone number you want to program (up to 24 digits).
  5. Press [Hold].
  6. Record the code and number you have just programmed.
Hope this helps.

Feb 02, 2011 | NorStar Jazz Plus 4400 Corded Phone

2 Answers

Trying to factory restor my lg 9800 but dont have security code since I bought phone used how can I reset to erase all the previous owners **** ?


1 - Open the Flip
2 - Press MENU >> Then ' 0 ' [ zero ]
3 - At the Service Code prompt enter six zeros
4 - Choose option 12

Phone should REBOOT and RESET to Factory Defaults... But, if you want to go to the pre-activation stage, that's a different process...

1 - Flip Open, Press Menu
2 - Press 0 followed by 000000 [6 zeros at the Sevice Code Prompt]
3 - Choose Option 1 [ Service Program ]
4 - Click the OK soft button [brings you to the * Phone Number (MDN)* screen]
5 - At that screen enter 10 zeros - to replace your current phone number
6 - Click the OK soft-button
7 - At this screen repeat step number 5
8 - Now click END

Phone will REBOOT by itself and the screen will now display " Initial Programming Required " - This is what the Sales Rep sees when he/she opens the box and boots the phone the very first time to program it to your account


Nov 25, 2010 | Cell Phones

1 Answer

Changing the alarm code on the gaurdtec 500 series alarm


For a guardtec 593

Programming User Codes
(Master code only)
system.
1) With the display showing ' Un ' enter a Master code
2) The display will show ' SE '
3) Press NO five times, the display will show ' Uc ' (flashing).
4) Press YES, the display will show ' U- '
5) Enter the User number you wish to program (1 to 7) followed by YES
6) The display will show ' Co ' Enter the required code (4, 5 or 6 digits) followed
by YES. (Entering 000000 will delete an existing code).
7) The display will show ' t- ' enter the code type from the following list
1 = Set Only 2 = Main User 3 = User 4 = Master followed
by YES. A full description of code types is given on page 3.
8) The display will show ' Uc ' (flashing)

If you wish to program other User codes return to step 4
Or
To return to the Unset condition press 0

this is for the led version.

Aug 27, 2010 | House Brand Intrud Alert House Home Alarm...

1 Answer

Twenty-five numbers are entered from the keyboard into an array.The number to be searched is entered through the keyboard by user.Write a program to find if the number to be searched is present in the...


pseudo is
-> integer type count =0;
->Take input from user 'Number'
->loop from 0th to 24th element
->Compare each element with user entered number and if it matches then do count++.
finally display the count.

Jul 29, 2010 | Advanced Graphics Programming Using OpenGL...

1 Answer

How do you program so that when the phone rings you are able to pick up the call without hitting a button. Also when you make an outgoing call and you pick up the phone you get an active line instead of...


Sets that are programmed to ring should automatically have ringing line preference.

Programming is done on M7310, M7324 and T7316 sets.
To set up ringing you need to enter programming by pressing the feature key followed by **266344.When prompted to enter the password enter 266344.
The screen should say TERMINALS&SETS.
The 4 top line/feature keys are now used for programming2.gif.
At the terminals&sets prompt, press the show key (top right arrow).
The display should now ask for an extension number. Enter extension number you wish to program ringing on.
Press the show key (top right arrow)
The display should sat LINE ACCESS
Press the show key (top right arrow) .
The display should say LINE ASSIGNMENT.
Press the show key (top right arrow) .
The display ask for a line number. press list
The display should say line 001: appear only
press the Chng key till it says appear & ring
press next key (lower right arrow)The display should say line 002: appear only
press the Chng key till it says appear & ring
repeat procedure for remailing active lines
press the heading key (top left arrow) til the screen says terminals&sets again

Prime line assignment is also programmed at the terminals&sets prompt.
press the show key (top right arrow). The display should now ask for an extension number. Enter extension number you want to change the prime line on.
Press the show key (top right arrow)
The display should say Line Access
Press the show key (top right arrow)
The display should say Line Assignment
Press the next key (bottom right arrow) .
The display should say Line Pool Access.
Press the next key (top right arrow)
The display should say Prime Line
Press the show key (top right arrow)
Press the Chng soft key till you get to the desired line or pool to pick up on
Press the release key when finished

Oct 19, 2009 | NorStar Meridian M7310 Phone

1 Answer

I have a Samsung U520 and I accidentally activated NAM2. Now my phone does not work. When I try to deactivate NAM2 it asks for a password. Can you help? It needs a 4 digit code. It also states Initial...


hi sir have you done restore factory settings firstThe Nokia 2160 series hand portable CMT uses an EEPROM NAM that can be programmed directly from the standard user keypad. In order to access the 
NAM, you must enter the special access code currently programmed into the 
phone. Once the programming mode is accessed, NAM parameters are loaded 
by entering them into the display and "storing" them to selected memory 
locations. Be sure to obtain all parameters before proceeding. 

EASY NAM PROGRAMMING 

1. Turn on phone. 

2. Enter the Easy NAM access code. Access code is: *#639# 

3. Verify the display now reads "Cellular Number" and enter the 10 digit 
MIN for the phone. 

4. Press the softkey under the word "OK" in the display. If less than 10 
digits are entered an error message will prompt you to reenter the 
number. 

5. Verify the display reads "Enter code" and enter the five digit SID 
followed by four zeros. (Example 001750000 is a SID of 175 followed 
by four zeros). An error message will display if an incorrect entry 
is made. Do not add more than four zeros to the code. 

Note: Change the Lock code by adding a pound sign and new lock code after 
the code. (Example: 001750000#7788. Lock code = 7788). 

Change the Language code by adding a pound sign (#) and new 
language code after the code. (Example: 001750000#2. Language = 2) 

Language Code: 0 (default) = English, 1 = French, 2 = Spanish, 
3 = Portuguese 

Change the Lock code and Language code by separating each set of 
numbers by a pound sign. (Example: 001750000#7788#2). The SID = 
00175, Lock code = 7788, Language = 2 (Spanish). 

6. Press the softkey under the word "OK" in the display. 

7. The display will tell you t

Sep 10, 2008 | Samsung Cell Phones

1 Answer

Need code


Try the Following Five Programs

1) Program for Prime Number Generation

#include <stdio.h>
main()
{
int n,i=1,j,c;
clrscr();
printf("Enter Number Of Terms
");
printf("Prime Numbers Are Follwing
");
scanf("%d",&n);
while(i<=n)
{
c=0;
for(j=1;j<=i;j++)
{
if(i%j==0)
c++;
}
if(c==2)
printf("%d ",i)
i++;
}
getch();
}
--------------------------------------------------------------------------------------------------------------------------------------------------

2)Program for finding the prime numbers

#include <stdio.h>
#include <conio.h>
void main()
{
int n,m,k,i,max;
char c;
clrscr();
repeat: max=0;
k=2;
n=1;
printf("You want prime numbers upto:- ");
scanf("%d",&max);
printf("

");
for (i=1;i<=max;i++)
{
again: m=(n/k)*k;
if (m!=n)
k=k+1;
else
goto try1;
if (k < n/2)
goto again;
else
printf("%d",n);
printf(" ");
try1: n=n+1;
k=2;
}
fflush(stdin);
printf ("

Do you want to continue?(y/n):- ");
scanf("%c",&c);
if (c=='y')
goto repeat;
getch();

}
---------------------------------------------------------------------------------------------------------------------------------------------------

3)
  1. #include <stdio.h>
  2. int main(void) {
  3. int n,
  4. lcv,
  5. flag; /* flag initially is 1 and becomes 0 if we determine that n
  6. is not a prime */
  7. printf("Enter value of N > ");
  8. scanf("%d", &n);
  9. for (lcv=2, flag=1; lcv <= (n / 2); lcv++) {
  10. if ((n % lcv) == 0) {
  11. if (flag)
  12. printf("The non-trivial factors of %d are: \n", n);
  13. flag = 0;
  14. printf("\t%d\n", lcv);
  15. }
  16. }
  17. if (flag)
  18. printf("%d is prime\n", n);
  19. }
---------------------------------------------------------------------------------------------------------------------------------------------------

4)

#include<stdio.h>

#include<conio.h>

void main()

{

int n,i,c=0;

clrscr();

printf("enter the number:");

scanf("%d",&n);

for(i=1;i<=n;i++)

{

if(n%i==0)

{

c=c+1;

}

}

if(c==2)

printf("number is prime");

else

printf("number is not prime");

getch();

}
-------------------------------------------------------------------------

5)
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("enter the number:");
scanf("%d",&a);
for(b=2;b<a/2;b++)
{
if(n%i==0)
{
printf("\n Its not a Prime number");
c=1;
break;
}
if(flag==0)
printf("\n Its a Prime Number");
getch();
}
}


Sep 02, 2008 | Computers & Internet

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

692 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Doctor PC
Doctor PC

Level 3 Expert

7733 Answers

kakima

Level 3 Expert

102366 Answers

David Payne
David Payne

Level 3 Expert

14161 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...