473,396 Members | 1,777 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,396 software developers and data experts.

table drawing

include <stdio.h>


int main(void){
int j,Lim,i,flag;
printf("Please enter a limit number : ");
scanf("%d",&Lim);

for(i=2;i<=Lim;i++){
for(j=2;j<=i-1;j++){
if(i%j==0){
flag=0;
break;}
flag=1;
}
if(flag==1)
printf("%5",i, "%5d",i);
}

return 0;
}
this is my code it get a number and print prime numbers between 2 and entered number i have to print that numbers in this vay
3 5 7 and in each row must be ten it means if we enter 100 the first line will continue till 31 then next line will start with 37 i try \t but it changes spacing to 8

3 5 7 11 13 17 19 23 29 31 .... this is the way that out put will be
Oct 28 '06 #1
0 1608

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

Similar topics

1
by: Andromeda | last post by:
I'm drawing a bit of a blank on the proper way to set up one specific table. I need to enter the fees and additional charges for people my company farms out work to across the US seperated by...
3
by: Quetzal | last post by:
Hello, I have a dataset populated using an XML file. The schema has hierarchical components. Let's say <a><b></b></a>. I have created a datagrid and I have assigned a datastyle and then...
16
by: Barbara de Zoete | last post by:
Here's what I'm trying to do: Create a table with generic style property . Have a few table cells in the thead that 'have to' melt into eachother, so needing the style . Looking somthing...
2
by: GV | last post by:
Hi all, I created 2 label controls and add them to a table cell the first one is fine left justified but i want to right justify the 2nd label control to the right of the cell? How to you...
6
by: polocar | last post by:
Hi, I'm writing a program in Visual C# 2005 Professional Edition. This program connects to a SQL Server 2005 database called "Generations" (in which there is only one table, called...
0
by: Slim | last post by:
I have page that takes some counties from a database and builds a table adding a cell with a button to each row. I have attached a event to each button when clicked it builds a second table that...
2
oszapped
by: oszapped | last post by:
I am new to creating SQL queries and need some help. I am trying to query from three tables. 1 - A table with a list of Drawings (DRAWINGS) 2 - A table with the Revision history of the Drawings...
2
by: Mufasa | last post by:
I need to create a table dynamically do I'm using the asp:table with rows and cells. All works fine. But I'd like to have it so that when a person hovers over the cell the background color changes....
2
m6s
by: m6s | last post by:
Good morning. I have a major issue with iText. Major but most of all ridiculous. After the cration of a table like that tbl = new Table(7, dataTbl.Rows.Count);...
0
by: pzero24 | last post by:
I am trying to add a color table to the RTF of my RichTextBox control when I instantiate the control. The problem is that the color table will not stay there. The only time it stays is if I have text...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.