473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Please Discribe This Program For Me

Expand|Select|Wrap|Line Numbers
  1.  #include<stdio.h> 
  2. #include<math.h>
  3. #define mod %
  4. int main()
  5. {
  6.     unsigned char flag,counter=0,rows=0;
  7.     long unsigned int number,i,j;
  8.     printf("\n\t Enter your number:");
  9.     scanf("%du",&number);
  10.     for(i=1;i<=(long unsigned int)abs(number);i++)
  11.     { 
  12.         flag=0;
  13.         j=2;
  14.         while(j<=(long unsigned int)sqrt(i))
  15.         {
  16.             if(i mod j==0)
  17.             {
  18.                 flag=1;
  19.                 break;
  20.             }
  21.             j++;
  22.         }
  23.         if(flag==0)
  24.         {
  25.             printf("%10lu",i);
  26.             counter++;
  27.             if(counter==10)
  28.             {
  29.                 printf("\n");
  30.                 counter=0;
  31.                 rows++;
  32.             }
  33.             if(rows==20)
  34.             {
  35.                 rows=0;
  36.                 printf("\n\t\t Press any key to view next page... \n");
  37.             }
  38.         }
  39.     }
  40.     printf("\n");
  41.     return 0;
  42. }
  43.  
Oct 22 '06 #1
0 895

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: da Vinci | last post by:
Hello again. I have a question regaring pass-by-reference and multiple functions. This is an assignment that I have to use pass-by-reference for everything. First off, I made the following...
7
by: tyler_durden | last post by:
thanks a lot for all your help..I'm really appreciated... with all the help I've been getting in forums I've been able to continue my program and it's almost done, but I'm having a big problem that...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
3
by: promiscuoustx | last post by:
I am trying to get my program to compile, but it will not complete. At line 79 it states, cannot convert 'float()()' to 'float' in assignment. Here is my code. #include <iostream> #include...
0
by: raa abdullah | last post by:
Overview A conflict-serializbility\recoverability checker, SCR, is a program that takes in a schedule and outputs 2 decisions: Conflict serialzable or Not confilict serializable AND Recoverable or...
2
by: Bsnpr8 | last post by:
I need help guys, i have to many stuff to do, because i am in my last 2 weeks of the university, my last assignment is to do a spell checker in C++, i have an idea but nothing is coming out. I really...
3
by: marsguy85 | last post by:
2 DAYS TO SUBMIT AND I COULD NOT GET MY HEAD AROUND TO DO IT , I HAVE BEEN STUDING VERY HARD FOR ALL SUBJECTS INCLUDING ANSI C BUT ITS HARD . PLEASE SAVE ME . GOD BLESS U. Hello friends i have to...
5
by: weidongtom | last post by:
Hi, I tried to implement the Universal Machine as described in http://www.boundvariable.org/task.shtml, and I managed to get one implemented (After looking at what other's have done.) But when I...
5
by: mohammaditraders | last post by:
Question # 1 Write a program which consists of a class named Student, the class should consists of three data members Name, Ob_marks, Total_marks and two member functions...
6
by: fido19 | last post by:
Once upon a time, there lived a chimpanzee called Luycha Bandor (aka Playboy Chimp). Luycha was unhappily married to Bunty Mona, a short but cute little lady chimp. Luycha was tall and handsome –...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.