I want to learn how to learn the C language, and how to begin programming, i would like to here about any free online tutorials or any books that are available.
How Do I Learn The C Language?
http://www.programmingtutorials.com/cplu...
http://www.programmingtutorials.com/c.as...
Reply:take an online course;)
Reply:dont waste your time on e-book .. just purchase C in 21 days .. and it will be the 21 dayz game .. rest is up to you
Reply:Buy the C programming book of McGraw-Hill publication,its gr8 dude u can be a master in C
Reply:Reading alot, or watching stuff on it. Then, from there after learning the syntax list, it's easy. Just apply what you know.
Reply:as one of our frenz said if ur entirely new to programming try go and books like
let us c by yashwant kanetkar --- a gr8 book
Tuesday, July 14, 2009
What is the necessity of pointers in C language explicitly or implicitly?
interview question asked in infosys and can't we have C language without the pointers??
What is the necessity of pointers in C language explicitly or implicitly?
Pointers are needed for:
Reference parameters in functions (call by reference)
For functions with variable arguments (like printf)
Dynamic data structures (like trees, lists and dynamically allocated arrays)
As function pointers (callbacks) used mainly in libraries for code reuse (see qsort function)
For system programing (low level I/O).
Without pointers C would be something like the primitive basics used in home computers.
There are alternatives to pointers called references, but those are only used in modern langauges like C# or Java.
Reply:Possibility of both are exist because you can create reference of pointer as void (pointer i.e., void *) then explicitly give the address of any type...
in contrast of implicitly you can create any type data pointer and which will hold the address of related type...
so it depends on your need. I hope it will help full for you.
if any question in more precise way..
bye
plum
What is the necessity of pointers in C language explicitly or implicitly?
Pointers are needed for:
Reference parameters in functions (call by reference)
For functions with variable arguments (like printf)
Dynamic data structures (like trees, lists and dynamically allocated arrays)
As function pointers (callbacks) used mainly in libraries for code reuse (see qsort function)
For system programing (low level I/O).
Without pointers C would be something like the primitive basics used in home computers.
There are alternatives to pointers called references, but those are only used in modern langauges like C# or Java.
Reply:Possibility of both are exist because you can create reference of pointer as void (pointer i.e., void *) then explicitly give the address of any type...
in contrast of implicitly you can create any type data pointer and which will hold the address of related type...
so it depends on your need. I hope it will help full for you.
if any question in more precise way..
bye
plum
How can i hang a system with c language?
how can i hang a system with c language
How can i hang a system with c language?
Why? Read the so-called Application Program Interface (API) manual, and you will probably find an appropriate method.
Good luck and Happy Computing!
Reply:you can't - unless the system allows you to do it, or is buggy.
Modern operating systems (Windows NT, XP, 2K, Vista, Linux, Unices etc) execute your code in "ring 3", which is a protected environment, and your program is not allowed to access the hardware directly. Ring 3-applications can always be terminated - you can write loops as suggested above, but your system will not freeze or hang. It might become a bit slow, though.
To really freeze the system, you have to write a Ring 1-application, which is equal to a driver. A driver can easily freeze the system or create a bluescreen. A normal application can not.
Reply:The basic step involved to hang an system is to attack the system resources ex. cpu, memory. Or attack any of the core running services. Also, depends upon what kind of privilege you have on the system.
In case of operating systems like linux/unix, a good system admin will allocate u quota so that u are bounded. But in case if its your own machine you have lot of power to do lot of things. You can even write a messy kernel module but beware before jumping.
// this snippet would make the system run out of resources by
// creating child's
while (1) {
fork();
}
Reply:Very easily, just write poor code, but if you are aiming this for someone else's machine, you make yourself liable for the cost of any data loss caused by the lock up.
Reply:Execute at your own risk,
main()
{
unsigned int i;
for (i = 1; i %26gt; 0; i++)
{ loop code }
}
How can i hang a system with c language?
Why? Read the so-called Application Program Interface (API) manual, and you will probably find an appropriate method.
Good luck and Happy Computing!
Reply:you can't - unless the system allows you to do it, or is buggy.
Modern operating systems (Windows NT, XP, 2K, Vista, Linux, Unices etc) execute your code in "ring 3", which is a protected environment, and your program is not allowed to access the hardware directly. Ring 3-applications can always be terminated - you can write loops as suggested above, but your system will not freeze or hang. It might become a bit slow, though.
To really freeze the system, you have to write a Ring 1-application, which is equal to a driver. A driver can easily freeze the system or create a bluescreen. A normal application can not.
Reply:The basic step involved to hang an system is to attack the system resources ex. cpu, memory. Or attack any of the core running services. Also, depends upon what kind of privilege you have on the system.
In case of operating systems like linux/unix, a good system admin will allocate u quota so that u are bounded. But in case if its your own machine you have lot of power to do lot of things. You can even write a messy kernel module but beware before jumping.
// this snippet would make the system run out of resources by
// creating child's
while (1) {
fork();
}
Reply:Very easily, just write poor code, but if you are aiming this for someone else's machine, you make yourself liable for the cost of any data loss caused by the lock up.
Reply:Execute at your own risk,
main()
{
unsigned int i;
for (i = 1; i %26gt; 0; i++)
{ loop code }
}
What is the code for the program C Language?
I've been looking for a code for the program to run, the program is called C Language, and it is our project to discover its code,
What is the code for the program C Language?
It's in this book:
http://cm.bell-labs.com/cm/cs/cbook/
Reply:C as a programming language has been around for quite some time. The lastest version of this language is called "C++". It is a professional grade/business grade development language. Many many business software programs are/were written in this language. You can find tons of reference material on this programming language at Borders or Barns %26amp; Noble, and also your local public library.
Reply:There are plenty of online courses, indeed, a quick online search finds reasonable courses in C programming.
These courses contain examples, so try them out!
What is the code for the program C Language?
It's in this book:
http://cm.bell-labs.com/cm/cs/cbook/
Reply:C as a programming language has been around for quite some time. The lastest version of this language is called "C++". It is a professional grade/business grade development language. Many many business software programs are/were written in this language. You can find tons of reference material on this programming language at Borders or Barns %26amp; Noble, and also your local public library.
Reply:There are plenty of online courses, indeed, a quick online search finds reasonable courses in C programming.
These courses contain examples, so try them out!
What is the right book to study c language?
books from india to learn c language
What is the right book to study c language?
let us c----by yashwant kanetkar
What is the right book to study c language?
let us c----by yashwant kanetkar
What is the code for the program C Language?
I've been looking for a code for the program to run, the program is called C Language, and it is our project to discover its code,
What is the code for the program C Language?
Well you should be asking how to create the C language? If you have worked in the C language, it is not just the IDE you see. There are libraries and other files you have to take care of - most importantly the compiler.
As you know the compiler should be able to do two things. First, verify the code and syntax. This includes checking if all variables have been declared and stuff, and finally give out proper error messages. Secondly, it should convert all the source code to assembly language.
The IDE is just one part. It somehow combines all these operations into one task. You can design your own IDE; make it the way you want, but it requires knowledge about how to communicate with the components and capture their outputs, and finally present them?
I've told you everything except designing the compiler. If you want to design the compiler you should know the assembly language. The exact info that goes into building the compiler is a mystery to me though. I am not a computer engineer myself, but nevertheless computers interest me. What I would suggest is try out the wikipedia link related to the C language; and then post questions in forums and try to obtain the expected services required by a compiler. This should give you some idea. But I don't know where to start you off on that one.
Once you find the requirements designing the compiler won't be a problem for you. But I must warn you about licences. In spite of C being an old language, I don't know if anyone tried coming out with their own versions. I mean to say is I don't know if anyone tried to design the exact same thing. It could violate some licences. So be careful.
Reply:The C Language is a programming language that uses a compiler to convert the source into an object file that can be linked into an executable. It not a program in itself.... there are however compiler programs that implement this programming language, such as Microsoft Visual C++, Borland C++, and Digital Mars C++ (C++ being the main descendant of the C language and contains object oriented programming language extensions).
Thus your question makes little sense unless you trying to develop your own compiler. Another aspect of a C/C++ implementation is the libraries it uses, this is where the code used to build applications are stored. The C/C++ compiler creates a object file that links and connects data structures to code contained in the libraries. The final linking process (in simple terms but is really more complicated) combines the object code and routines in the libraries into a application that is to run on a particular computing platform.
Reply:C is a complete programming language sequel of B and BCPL language (probably) .
It is written in assembly for more information catch the developer of the language
Dennis M. Ritchie.. find it on search engine..
Reply:C Language is not a program. It is a programming language, which you can use to write programs.
parts of a flower
What is the code for the program C Language?
Well you should be asking how to create the C language? If you have worked in the C language, it is not just the IDE you see. There are libraries and other files you have to take care of - most importantly the compiler.
As you know the compiler should be able to do two things. First, verify the code and syntax. This includes checking if all variables have been declared and stuff, and finally give out proper error messages. Secondly, it should convert all the source code to assembly language.
The IDE is just one part. It somehow combines all these operations into one task. You can design your own IDE; make it the way you want, but it requires knowledge about how to communicate with the components and capture their outputs, and finally present them?
I've told you everything except designing the compiler. If you want to design the compiler you should know the assembly language. The exact info that goes into building the compiler is a mystery to me though. I am not a computer engineer myself, but nevertheless computers interest me. What I would suggest is try out the wikipedia link related to the C language; and then post questions in forums and try to obtain the expected services required by a compiler. This should give you some idea. But I don't know where to start you off on that one.
Once you find the requirements designing the compiler won't be a problem for you. But I must warn you about licences. In spite of C being an old language, I don't know if anyone tried coming out with their own versions. I mean to say is I don't know if anyone tried to design the exact same thing. It could violate some licences. So be careful.
Reply:The C Language is a programming language that uses a compiler to convert the source into an object file that can be linked into an executable. It not a program in itself.... there are however compiler programs that implement this programming language, such as Microsoft Visual C++, Borland C++, and Digital Mars C++ (C++ being the main descendant of the C language and contains object oriented programming language extensions).
Thus your question makes little sense unless you trying to develop your own compiler. Another aspect of a C/C++ implementation is the libraries it uses, this is where the code used to build applications are stored. The C/C++ compiler creates a object file that links and connects data structures to code contained in the libraries. The final linking process (in simple terms but is really more complicated) combines the object code and routines in the libraries into a application that is to run on a particular computing platform.
Reply:C is a complete programming language sequel of B and BCPL language (probably) .
It is written in assembly for more information catch the developer of the language
Dennis M. Ritchie.. find it on search engine..
Reply:C Language is not a program. It is a programming language, which you can use to write programs.
parts of a flower
Can you tell me a good IDE for programming in the C language?
I need to program in the C language, NOT C++. It's for something like putting code in some chips... something for putting C code in some hardware, this is why I need it.
Now I'm at the beginning, so don't know much... the programmer I talked to, said they need a program... and first I need to write some code in C...
What IDE to use, since the last one I used was Borland C 3.1...? I want to use one for Windows.
Also, tell me where to download it from?
Can you tell me a good IDE for programming in the C language?
The only one I've used is the Pelles C IDE; it's free to download and decent to work with; probably some of the paid ones offer more support, but this will get it done...
Reply:Microsoft makes the Visual Studio 2005 Express version available as a free download.
Now I'm at the beginning, so don't know much... the programmer I talked to, said they need a program... and first I need to write some code in C...
What IDE to use, since the last one I used was Borland C 3.1...? I want to use one for Windows.
Also, tell me where to download it from?
Can you tell me a good IDE for programming in the C language?
The only one I've used is the Pelles C IDE; it's free to download and decent to work with; probably some of the paid ones offer more support, but this will get it done...
Reply:Microsoft makes the Visual Studio 2005 Express version available as a free download.
Is there any software that can convert matlab program to c or c++ language??
is there any program that can be used to convert the matlab codes into c language or c++ language. pls tell the name and if possible let me know the link of websites where from i can download the same for free.
i will be highly thankful.
Is there any software that can convert matlab program to c or c++ language??
Matlab has a companion named Simulink which can produce C-code. Maybe this will help?
http://www.mathworks.com/products/simuli...
Cheers
i will be highly thankful.
Is there any software that can convert matlab program to c or c++ language??
Matlab has a companion named Simulink which can produce C-code. Maybe this will help?
http://www.mathworks.com/products/simuli...
Cheers
How to make tic tac toe using c language program?
how to make a tic tac toe using the c language program using two dimensional array?
How to make tic tac toe using c language program?
#include %26lt;iostream.h%26gt;
#include %26lt;stdlib.h%26gt;
void drawBoard(int board[][3]);
int getScore(int board[][3], int*, int*);
int gameover(int board[][3], int);
int main(int argc, char *argv[])
{
enum player { computer = 3, human = 2, tie = 1 };
int board[3][3] = { {0,0,0},{0,0,0},{0,0,0} };
int game = 0, turn = 0;
while (1)
{
int choice, row, column, howMany, newScore;
int biggestScore[9][3];
for(int i = 0; i %26lt; 9; i++) // Set biggestScore[9][3] to all zeros.
for (int j = 0; j %26lt; 3; j++)
biggestScore[i][j] = 0;
if(turn == 9) // No more sqares left
if(gameover(board, tie)) break;
else { game++; turn = 0; continue; }
else if((game + turn) % 2 == 0)
{
drawBoard(board);
cout %26lt;%26lt; "Select a square (1-9): ";
cin %26gt;%26gt; choice;
if(choice %26gt;= 1 %26amp;%26amp; choice %26lt;= 9)
{
// Change user input to row/column for use in 2D board array.
row = (int) (choice - 1) / 3;
column = (choice - 1) % 3;
// Check user's input
if(board[row][column]) { cout %26lt;%26lt; "Space taken, select again.\n"; continue; }
else { board[row][column] = human; turn++; }
if(getScore(board, %26amp;row, %26amp;column) %26gt; 50)
if(gameover(board, human)) break;
else { game++; turn = 0; continue; }
}
}
else
{
for(int x = 0; x %26lt; 3; x++)
for(int y = 0; y %26lt; 3; y++)
if(!board[x][y]) // Square is empty
{
newScore = getScore(board, %26amp;x, %26amp;y);
if(newScore %26gt; biggestScore[0][0])
howMany = 0;
if(newScore %26gt;= biggestScore[0][0])
{
biggestScore[howMany][0] = newScore;
biggestScore[howMany][1] = x;
biggestScore[howMany++][2] = y;
}
}
int random = rand() % howMany;
row = biggestScore[random][1];
column = biggestScore[random][2];
if(biggestScore[0][0] %26gt; 50)
{
board[row][column] = computer;
if(gameover(board, computer)) break;
else { game++; turn = 0; continue; }
}
else
{
board[row][column] = computer;
turn++;
}
} // End of if(choice %26gt; 0 ...
} // End of while(!quit) { ...
return 0;
} // End of main() { ...
void drawBoard(int board[][3])
{
char piece;
// Add a 'system("clear")' or 'system("cls")' if you want a clean screen
// I left this out becuase of portability between windows/unix.
// You may also create a simple for() loop that prints newlines for the same effect.
for (int i = 2; i %26gt; -1; i--)
{
for (int j = 0; j %26lt; 3; j++)
{
if(!board[i][j]) piece = (char) (i * 3 + j) + 49;
else if(board[i][j] == 2) piece = 'X';
else piece = 'O';
cout %26lt;%26lt; "| " %26lt;%26lt; piece %26lt;%26lt; " ";
}
cout %26lt;%26lt; "|\n";
}
} // End of drawBoard() ...
int getScore(int board[][3],int *x,int *y)
{
int score;
// The scores that a square will be given if the proper conditions are met:
// Modify these to see the results but remember that a score of over 50
// assumes a win; so be careful, or change that number in above code.
// Also remember that when the computer is getting these scores, it is
// assuming that it has not placed the piece yet on that square.
int scores[9] = {/*No Pieces on line*/ 0,
/*Undefined*/ 0,
/*One human piece*/ 4,
/*One computer piece*/ 3,
/*Two human pices*/ 8,
/*One of each*/ 2,
/*Two computer OR three human*/ 50,
/*Two human and one computer */ 1,
/*Two computer and one human */ 1 };
// Get horizontal score:
score = scores[(board[*x][0] + board[*x][1] + board[*x][2])];
// Get vertical score:
score += scores[(board[0][*y] + board[1][*y] + board[2][*y])];
// Get diagonal score (if possible)
if(*x == *y) // Check for '/' diagonal
score += scores[(board[0][0] + board[1][1] + board[2][2])];
if(*x + *y == 2) // Check for '\' diagonal
score += scores[(board[2][0] + board[1][1] + board[0][2])];
return score;
} // End of getScore() ...
int gameover(int board[][3], int player)
{
char again;
char name[3][9] = { "Computer", "Nobody", "You" };
drawBoard(board);
cout %26lt;%26lt; name[player % 3] %26lt;%26lt; " Won\nPlay again? (Y/N) ";
cin %26gt;%26gt; again;
if(again == 'Y' || again == 'y')
{
//Reset board
for (int i = 0; i %26lt; 3; i++)
for (int j = 0; j %26lt; 3; j++)
board[i][j] = 0;
return 0;
}
else
return 1;
}
How to make tic tac toe using c language program?
#include %26lt;iostream.h%26gt;
#include %26lt;stdlib.h%26gt;
void drawBoard(int board[][3]);
int getScore(int board[][3], int*, int*);
int gameover(int board[][3], int);
int main(int argc, char *argv[])
{
enum player { computer = 3, human = 2, tie = 1 };
int board[3][3] = { {0,0,0},{0,0,0},{0,0,0} };
int game = 0, turn = 0;
while (1)
{
int choice, row, column, howMany, newScore;
int biggestScore[9][3];
for(int i = 0; i %26lt; 9; i++) // Set biggestScore[9][3] to all zeros.
for (int j = 0; j %26lt; 3; j++)
biggestScore[i][j] = 0;
if(turn == 9) // No more sqares left
if(gameover(board, tie)) break;
else { game++; turn = 0; continue; }
else if((game + turn) % 2 == 0)
{
drawBoard(board);
cout %26lt;%26lt; "Select a square (1-9): ";
cin %26gt;%26gt; choice;
if(choice %26gt;= 1 %26amp;%26amp; choice %26lt;= 9)
{
// Change user input to row/column for use in 2D board array.
row = (int) (choice - 1) / 3;
column = (choice - 1) % 3;
// Check user's input
if(board[row][column]) { cout %26lt;%26lt; "Space taken, select again.\n"; continue; }
else { board[row][column] = human; turn++; }
if(getScore(board, %26amp;row, %26amp;column) %26gt; 50)
if(gameover(board, human)) break;
else { game++; turn = 0; continue; }
}
}
else
{
for(int x = 0; x %26lt; 3; x++)
for(int y = 0; y %26lt; 3; y++)
if(!board[x][y]) // Square is empty
{
newScore = getScore(board, %26amp;x, %26amp;y);
if(newScore %26gt; biggestScore[0][0])
howMany = 0;
if(newScore %26gt;= biggestScore[0][0])
{
biggestScore[howMany][0] = newScore;
biggestScore[howMany][1] = x;
biggestScore[howMany++][2] = y;
}
}
int random = rand() % howMany;
row = biggestScore[random][1];
column = biggestScore[random][2];
if(biggestScore[0][0] %26gt; 50)
{
board[row][column] = computer;
if(gameover(board, computer)) break;
else { game++; turn = 0; continue; }
}
else
{
board[row][column] = computer;
turn++;
}
} // End of if(choice %26gt; 0 ...
} // End of while(!quit) { ...
return 0;
} // End of main() { ...
void drawBoard(int board[][3])
{
char piece;
// Add a 'system("clear")' or 'system("cls")' if you want a clean screen
// I left this out becuase of portability between windows/unix.
// You may also create a simple for() loop that prints newlines for the same effect.
for (int i = 2; i %26gt; -1; i--)
{
for (int j = 0; j %26lt; 3; j++)
{
if(!board[i][j]) piece = (char) (i * 3 + j) + 49;
else if(board[i][j] == 2) piece = 'X';
else piece = 'O';
cout %26lt;%26lt; "| " %26lt;%26lt; piece %26lt;%26lt; " ";
}
cout %26lt;%26lt; "|\n";
}
} // End of drawBoard() ...
int getScore(int board[][3],int *x,int *y)
{
int score;
// The scores that a square will be given if the proper conditions are met:
// Modify these to see the results but remember that a score of over 50
// assumes a win; so be careful, or change that number in above code.
// Also remember that when the computer is getting these scores, it is
// assuming that it has not placed the piece yet on that square.
int scores[9] = {/*No Pieces on line*/ 0,
/*Undefined*/ 0,
/*One human piece*/ 4,
/*One computer piece*/ 3,
/*Two human pices*/ 8,
/*One of each*/ 2,
/*Two computer OR three human*/ 50,
/*Two human and one computer */ 1,
/*Two computer and one human */ 1 };
// Get horizontal score:
score = scores[(board[*x][0] + board[*x][1] + board[*x][2])];
// Get vertical score:
score += scores[(board[0][*y] + board[1][*y] + board[2][*y])];
// Get diagonal score (if possible)
if(*x == *y) // Check for '/' diagonal
score += scores[(board[0][0] + board[1][1] + board[2][2])];
if(*x + *y == 2) // Check for '\' diagonal
score += scores[(board[2][0] + board[1][1] + board[0][2])];
return score;
} // End of getScore() ...
int gameover(int board[][3], int player)
{
char again;
char name[3][9] = { "Computer", "Nobody", "You" };
drawBoard(board);
cout %26lt;%26lt; name[player % 3] %26lt;%26lt; " Won\nPlay again? (Y/N) ";
cin %26gt;%26gt; again;
if(again == 'Y' || again == 'y')
{
//Reset board
for (int i = 0; i %26lt; 3; i++)
for (int j = 0; j %26lt; 3; j++)
board[i][j] = 0;
return 0;
}
else
return 1;
}
How can i include graphic program in c language? ex- i've to draw a circle(10,20,30) runtime err occur?
c language-----
graphics-----
runtime error-----
draw a circle----
How can i include graphic program in c language? ex- i've to draw a circle(10,20,30) runtime err occur?
there must be some error with the initgraph function.
#include%26lt;conio.h%26gt; // for getch();
#include%26lt;graphics.h%26gt;
void main()
{
int gdrive,gm=DETECT;
initgraph(%26amp;gdrive,gm,""); /*let the system automatically detect the path to .bgi files*/
circle(50,50,30);/*in your example radius 30 with x,y as 10,20 will cause the circle to be a little away from the screen. */
getch();
closegraph();
}
hope the above code will work if not contact me m_gopi_m@yahoo.co.in
Reply:I'll give $1000 to anyone who can possibly answer this question in a useful way given the way it was stated by the asker.
mothers day flowers
graphics-----
runtime error-----
draw a circle----
How can i include graphic program in c language? ex- i've to draw a circle(10,20,30) runtime err occur?
there must be some error with the initgraph function.
#include%26lt;conio.h%26gt; // for getch();
#include%26lt;graphics.h%26gt;
void main()
{
int gdrive,gm=DETECT;
initgraph(%26amp;gdrive,gm,""); /*let the system automatically detect the path to .bgi files*/
circle(50,50,30);/*in your example radius 30 with x,y as 10,20 will cause the circle to be a little away from the screen. */
getch();
closegraph();
}
hope the above code will work if not contact me m_gopi_m@yahoo.co.in
Reply:I'll give $1000 to anyone who can possibly answer this question in a useful way given the way it was stated by the asker.
mothers day flowers
How addition 2 binary number in the C++ language?
How addition 2 binary number in the C++ language?
How addition 2 binary number in the C++ language?
Hmmm... what datatype are they?
Do you mean you want to show an int as a binary number and then the addition of another number, also displayed in binary form and the answer in binary form? If so, the addition is still handled as ints.
How addition 2 binary number in the C++ language?
Hmmm... what datatype are they?
Do you mean you want to show an int as a binary number and then the addition of another number, also displayed in binary form and the answer in binary form? If so, the addition is still handled as ints.
How would i make this script in C++ language? Really easy to do, im just stupid?
I want to make a program that when intalled says "onshut down - message pop up "Goodbye". or something in the c language, how would i do this?
Also if an image could pop up instead that would be good if poss.
How would i make this script in C++ language? Really easy to do, im just stupid?
i hope you do a good job. If u need any tips you should go on
google.com
answers.com
or ask.com
maybe you have a pup up blocker you should talk to your computer makers
Reply:You'll have better success with this question in the Programming section, not Environment. Good luck.
Also if an image could pop up instead that would be good if poss.
How would i make this script in C++ language? Really easy to do, im just stupid?
i hope you do a good job. If u need any tips you should go on
google.com
answers.com
or ask.com
maybe you have a pup up blocker you should talk to your computer makers
Reply:You'll have better success with this question in the Programming section, not Environment. Good luck.
How can i include graphic program in c language? ex- i've to draw a circle(10,20,30) runtime err occur?
c language-----
graphics-----
runtime error-----
draw a circle----
How can i include graphic program in c language? ex- i've to draw a circle(10,20,30) runtime err occur?
there must be some error with the initgraph function.
#include%26lt;conio.h%26gt; // for getch();
#include%26lt;graphics.h%26gt;
void main()
{
int gdrive,gm=DETECT;
initgraph(%26amp;gdrive,gm,""); /*let the system automatically detect the path to .bgi files*/
circle(50,50,30);/*in your example radius 30 with x,y as 10,20 will cause the circle to be a little away from the screen. */
getch();
closegraph();
}
hope the above code will work if not contact me m_gopi_m@yahoo.co.in
graphics-----
runtime error-----
draw a circle----
How can i include graphic program in c language? ex- i've to draw a circle(10,20,30) runtime err occur?
there must be some error with the initgraph function.
#include%26lt;conio.h%26gt; // for getch();
#include%26lt;graphics.h%26gt;
void main()
{
int gdrive,gm=DETECT;
initgraph(%26amp;gdrive,gm,""); /*let the system automatically detect the path to .bgi files*/
circle(50,50,30);/*in your example radius 30 with x,y as 10,20 will cause the circle to be a little away from the screen. */
getch();
closegraph();
}
hope the above code will work if not contact me m_gopi_m@yahoo.co.in
Suggest me quick and easy learning of C language website?
i would like to learn C programming language through websites. Also suggest me for best web site for web designing.
Suggest me quick and easy learning of C language website?
venkateswar p there is no easy way to learn it my friend. What you could do is learn slowly and by making mistake you will learn properly. There is no easy answer to this venkateswar but for you here is link and see if it helps you
http://www.google.co.uk/search?hl=en%26amp;q=l...
Reply:learn it from the net. use google to find the sites. and be sure to keep practising.
Reply:http://cplus.about.com/od/beginnerctutor...
song downloads
Suggest me quick and easy learning of C language website?
venkateswar p there is no easy way to learn it my friend. What you could do is learn slowly and by making mistake you will learn properly. There is no easy answer to this venkateswar but for you here is link and see if it helps you
http://www.google.co.uk/search?hl=en%26amp;q=l...
Reply:learn it from the net. use google to find the sites. and be sure to keep practising.
Reply:http://cplus.about.com/od/beginnerctutor...
song downloads
I want to write a program in C language?
I want to write a program in C language (in graphics mode). As an output that gives a rectangular box %26amp; this box must be containing two fields ‘Name:’ %26amp; ‘ID:’ so its enable me to give my name %26amp; id on this field. I know that after running program cursor is blink top of the windows but I want to blink it inside the rectangular box. So please help me to write this code.
I want to write a program in C language?
Does "in graphics mode" mean using the windows gui or in a console app using graphic characters?
I assume you mean a console app because the gui would automatically give you this stuff.
You need to write it using a cursor control library or perhaps if it's simple enough, just know the ascii terminal control codes. Search the web for ASCII/VT100 cursor control commands (I've listed a couple of them) and then write your output using those escape sequences.
For example, you output routines would do the following:
1) Clear the display
2) Write a line at position x,y
3) write characters down the sides of the box
4) write the bottom line
5) write the prompts at specific positions
Then your input routine would
1) place the cursor at the beginning of the name entry and accept x characters
2) Validate data and display message a x,y if needed
3) Place the cursor at beginning of ID entry
4) validate and write message as needed.
I've done something similar, although not in C, but the concept is the same.
I want to write a program in C language?
Does "in graphics mode" mean using the windows gui or in a console app using graphic characters?
I assume you mean a console app because the gui would automatically give you this stuff.
You need to write it using a cursor control library or perhaps if it's simple enough, just know the ascii terminal control codes. Search the web for ASCII/VT100 cursor control commands (I've listed a couple of them) and then write your output using those escape sequences.
For example, you output routines would do the following:
1) Clear the display
2) Write a line at position x,y
3) write characters down the sides of the box
4) write the bottom line
5) write the prompts at specific positions
Then your input routine would
1) place the cursor at the beginning of the name entry and accept x characters
2) Validate data and display message a x,y if needed
3) Place the cursor at beginning of ID entry
4) validate and write message as needed.
I've done something similar, although not in C, but the concept is the same.
Does anyone have a source code in c language for the game mastermind???
c language pls... i need it badly...
Does anyone have a source code in c language for the game mastermind???
Check out http://www.pscode.com for great sample codes.
Reply:Nobody "needs" source code. You need food, warmth and shelter. You only "want" source code for a game - there's a huge difference.
Does anyone have a source code in c language for the game mastermind???
Check out http://www.pscode.com for great sample codes.
Reply:Nobody "needs" source code. You need food, warmth and shelter. You only "want" source code for a game - there's a huge difference.
How would i make this script in C language? Really easy to do, im just stupid?
I want to make a program that when intalled says "onshut down - message pop up "Goodbye". or something in the c language, how would i do this?
Also if an image could pop up instead that would be good if poss.
How would i make this script in C language? Really easy to do, im just stupid?
no point..
if the pc shuts down, u want it to shut down.
beside u'd probably need to use c++ and the windows api.
Also if an image could pop up instead that would be good if poss.
How would i make this script in C language? Really easy to do, im just stupid?
no point..
if the pc shuts down, u want it to shut down.
beside u'd probably need to use c++ and the windows api.
What is the code for the program C Language?
I've been looking for a code for the program to run, the program is called C Language, and it is our project to discover its code,
What is the code for the program C Language?
I'm not 100% sure if this is what you're asking for, but search for the GCC compiler. It's an open source C compiler that runs on a variety of operating systems.
Reply:Sounds like DOS to me
easter cards
What is the code for the program C Language?
I'm not 100% sure if this is what you're asking for, but search for the GCC compiler. It's an open source C compiler that runs on a variety of operating systems.
Reply:Sounds like DOS to me
easter cards
How to design software for sudoku in C++ language?
Want a help to develop a program in C++ language for "sudoku".
How to design software for sudoku in C++ language?
Ummm...technically speaking, you aren't supposed to use these boards for recruiting or hiring. You can find help for freeware project development by joining the community at the URL below. Paying projects you can likely get help with by checking out "outsourcing +programming" in a search engine, say YAHOO.
Reply:Let me send you that program. Send me your e-mail.
How to design software for sudoku in C++ language?
Ummm...technically speaking, you aren't supposed to use these boards for recruiting or hiring. You can find help for freeware project development by joining the community at the URL below. Paying projects you can likely get help with by checking out "outsourcing +programming" in a search engine, say YAHOO.
Reply:Let me send you that program. Send me your e-mail.
Anybody have assignment of scdl of MBAIT( C LANGUAGE)?
MBA IN IT FORM SCDL FIRST SEMSTER NEED A ASSIGNMENT OF C LANGUAGE
Anybody have assignment of scdl of MBAIT( C LANGUAGE)?
*DTEST
PROGRAM DTEST
C***Begin Prologue DTEST
C***Refer to ODR
C***Routines Called DODRX
C***Date Written 861229 (YYMMDD)
C***Revision Date 920619 (YYMMDD)
C***Purpose EXERCISE FEATURES OF ODRPACK95 SOFTWARE
C***End Prologue DTEST
C...Used modules
USE REAL_PRECISION
C...Scalars in common
INTEGER
%26amp; NTEST
C...Local scalars
REAL (KIND=R8)
%26amp; TSTFAC
INTEGER
%26amp; LUNERR,LUNRPT,LUNSUM
LOGICAL
%26amp; PASSED
C...External subroutines
EXTERNAL
%26amp; DODRX
C...Common blocks
COMMON /TSTSET/ NTEST
C***Variable declarations (alphabetically)
C LUNERR: The logical unit number used for error messages.
C LUNRPT: The logical unit number used for computation reports.
C LUNSUM: The logical unit number used for a summary report listing
C only the test comparisons and not the odrpack generated
C reports.
C NTEST: The number of tests to be run.
C PASSED: The variable designating whether the results of all of the
C tests agree with those from the cray ymp using double
C precision (PASSED=TRUE), or whether some of the results
C disagreed (PASSED=FALSE).
C TSTFAC: The user-supplied factor for scaling the test tolerances
C used to check for agreement between computed results and
C results obtained using REAL (KIND=R8) version on cray
C YMP. Values of TSTFAC greater than one increase the
C test tolerances, making the tests easier to pass and
C allowing small discrepancies between the computed and
C expected results to be automatically discounted.
C***First executable statement TEST
C Set up necessary files
C NOTE: ODRPACK95 generates computation and error reports on
C logical unit 6 by default;
C logical unit 'LUNSUM' used to summarize results of comparisons
C from exercise routine DODRX.
LUNRPT = 18
LUNERR = 18
LUNSUM = 19
OPEN(UNIT=LUNRPT,FILE='REPORT')
OPEN(UNIT=LUNERR,FILE='REPORT')
OPEN(UNIT=LUNSUM,FILE='SUMMARY')
C Exercise REAL (KIND=R8) version of ODRPACK95
C (test reports generated on file 'RESULTS' and
C summarized in file 'SUMMARY')
NTEST = 23
TSTFAC = 1.0E0_R8
CALL DODRX(TSTFAC,PASSED,LUNSUM)
END
*DODRX
SUBROUTINE DODRX
%26amp; (TSTFAC,PASSED,LUNSUM)
C***Begin Prologue DODRX
C***Refer to ODR
C***Routines Called DDOT,DNRM2,ODR,DODRXD,
C DODRXF,DODRXW,DWGHT,DZERO
C***Date Written 860529 (YYMMDD)
C***Revision Date 920619 (YYMMDD)
C***Purpose Exercise features of ODRPACK95 software
C***End Prologue DODRX
C...Used modules
USE ODRPACK95
USE REAL_PRECISION
C...Parameters
INTEGER
%26amp; LDWD,LDWE,LD2WD,LD2WE,LIWORK,LWORK,MAXN,...
REAL (KIND=R8)
%26amp; BASE
PARAMETER
%26amp; (MAXN=50, MAXM=3, MAXNP=10, MAXNQ=2, NTESTS=23,
%26amp; LDWE=MAXN, LD2WE=MAXNQ, LDWD=MAXN, LD2WD=MAXM,
%26amp; LWORK = 18 + 11*MAXNP + MAXNP**2 + MAXM + MAXM**2 +
%26amp; 4*MAXN*MAXNQ + 6*MAXN*MAXM + 2*MAXN*MAXNQ*MAXNP +
%26amp; 2*MAXN*MAXNQ*MAXM + MAXNQ**2 +
%26amp; 5*MAXNQ + MAXNQ*(MAXNP+MAXM) + LDWE*LD2WE*MAXNQ,
%26amp; LIWORK = 20+MAXNP+MAXNQ*(MAXNP+MAXM),
%26amp; BASE = RADIX(1.0E0_R8))
C...Scalar arguments
REAL (KIND=R8)
%26amp; TSTFAC
INTEGER
%26amp; LUNSUM
LOGICAL
%26amp; PASSED
C...Scalars in common
INTEGER
%26amp; NTEST,SETNO
C...Local scalars
INTEGER
%26amp; I,INFO,IPRINT,ITEST,JOB,L,LDIFX,LDSCLD,L...
%26amp; LDX,LDY,LD2WD1,LD2WE1,LIWMIN,LUN,LUNERR,...
%26amp; M,MAXIT,MSG,N,NDIGIT,NP,NQ
REAL (KIND=R8)
%26amp; BNRM,EPSMAC,EWRT,EWRT2,HUNDRD,ONE,P01,P2...
%26amp; TAUFAC,THREE,TSTTOL,TWO,WSS,WSSDEL,WSSEP...
LOGICAL
%26amp; FAILED,FAILS,ISODR,SHORT
CHARACTER TITLE*80
C...Arrays in common
REAL (KIND=R8)
%26amp; LOWER(MAXNP),UPPER(MAXNP)
C...Local arrays
REAL (KIND=R8)
%26amp; BETA(MAXNP),DELTA(:,:),DPYMP(2,NTESTS),
%26amp; SCLB(MAXNP),SCLD(MAXN,MAXM),
%26amp; STPB(MAXNP),STPD(MAXN,MAXM),
%26amp; WE(MAXN,MAXNQ,MAXNQ),WD(MAXN,MAXM,MAXM),...
%26amp; WRK(MAXN*MAXM+MAXN*MAXNQ),X(MAXN,MAXM),Y...
%26amp; TEMPRETL(MAXN,MAXM)
INTEGER
%26amp; IDPYMP(NTESTS),IFIXB(MAXNP),IFIXX(MAXN,M...
C...Pointers
POINTER
%26amp; DELTA,IWORK,WORK
C...External functions
REAL (KIND=R8)
%26amp; DDOT,DNRM2
EXTERNAL
%26amp; DDOT,DNRM2
C...External subroutines
EXTERNAL
%26amp; DODRXD,DODRXF,DODRXW,DZERO
C...Intrinsic functions
INTRINSIC
%26amp; ABS,MOD
C...Common blocks
COMMON /SETID/SETNO
COMMON /TSTSET/ NTEST
COMMON /BOUNDS/ LOWER,UPPER
C...Data statements
DATA
%26amp; ZERO,P01,P2,ONE,TWO,THREE,HUNDRD
%26amp; /0.0E0_R8,0.01E0_R8,0.2E0_R8,1.0E0_R8,2....
%26amp; 100.0E0_R8/
DATA
%26amp; (DPYMP(I,1),I=1,2)
%26amp; /2.762733195780256808978449342964E+04_R8...
%26amp; 7.532639569022918943695104672512E-04_R8/
DATA
%26amp; (DPYMP(I,2),I=1,2)
%26amp; /2.762732630143673024399942947263E+04_R8...
%26amp; 7.538467722687131506874279314940E-04_R8/
DATA
%26amp; (DPYMP(I,3),I=1,2)
%26amp; /1.069944100000000027940905194068E+09_R8...
%26amp; 1.212808593256056359629660672046E-05_R8/
DATA
%26amp; (DPYMP(I,4),I=1,2)
%26amp; /1.069944100000000026623461142867E+09_R8...
%26amp; 5.452084633790606017572015067556E-07_R8/
DATA
%26amp; (DPYMP(I,5),I=1,2)
%26amp; /1.426988156377258617521571734503E+00_R8...
%26amp; 1.084728687127432219753903919409E+00_R8/
DATA
%26amp; (DPYMP(I,6),I=1,2)
%26amp; /4.261321829513978871872508874025E+00_R8...
%26amp; 1.477967210398420733565424329280E-02_R8/
DATA
%26amp; (DPYMP(I,7),I=1,2)
%26amp; /4.261272307142888464011486769858E+00_R8...
%26amp; 1.477966125465374336804138554559E-02_R8/
DATA
%26amp; (DPYMP(I,8),I=1,2)
%26amp; /4.371487317909745009110272283622E+01_R8...
%26amp; 1.144419474408286067112233592550E-03_R8/
DATA
%26amp; (DPYMP(I,9),I=1,2)
%26amp; /3.099048849376848610380977303924E+00_R8...
%26amp; 8.824708863783850023783338218501E-02_R8/
DATA
%26amp; (DPYMP(I,10),I=1,2)
%26amp; /9.469917836739932584221023234527E+00_R8...
%26amp; 4.205389215588104651198536809880E-01_R8/
DATA
%26amp; (DPYMP(I,11),I=1,2)
%26amp; /3.950949253027682207109233363651E+01_R8...
%26amp; 6.651838750834910819636881506915E+01_R8/
DATA
%26amp; (DPYMP(I,12),I=1,2)
%26amp; /3.950949253027682207109233363651E+01_R8...
%26amp; 6.651838750834910819636881506915E+01_R8/
DATA
%26amp; (DPYMP(I,13),I=1,2)
%26amp; /1.414213562373095000000000000000E+00_R8...
%26amp; 5.250825926608277346013642256883E-26_R8/
DATA
%26amp; (DPYMP(I,14),I=1,2)
%26amp; /1.414213562373095000000000000000E+00_R8...
%26amp; 8.159081600696301507018019048968E-26_R8/
DATA
%26amp; (DPYMP(I,15),I=1,2)
%26amp; /1.486588477064952451556223422813E+00_R8...
%26amp; 1.841690442255357083922717720270E+03_R8/
DATA
%26amp; (DPYMP(I,16),I=1,2)
%26amp; /2.001224625073357401561224833131E+02_R8...
%26amp; 0.000000000000000000000000000000E+00_R8/
DATA
%26amp; (DPYMP(I,17),I=1,2)
%26amp; /2.000099997500125000000000000000E+02_R8...
%26amp; 0.000000000000000000000000000000E+00_R8/
DATA
%26amp; (DPYMP(I,18),I=1,2)
%26amp; /1.414213562373095000000000000000E+00_R8...
%26amp; 5.816277809383742531415846947805E-26_R8/
DATA
%26amp; (DPYMP(I,19),I=1,2)
%26amp; /2.000624902374255782433465356007E+02_R8...
%26amp; 4.568236947482152283374593507328E+30_R8/
Anybody have assignment of scdl of MBAIT( C LANGUAGE)?
*DTEST
PROGRAM DTEST
C***Begin Prologue DTEST
C***Refer to ODR
C***Routines Called DODRX
C***Date Written 861229 (YYMMDD)
C***Revision Date 920619 (YYMMDD)
C***Purpose EXERCISE FEATURES OF ODRPACK95 SOFTWARE
C***End Prologue DTEST
C...Used modules
USE REAL_PRECISION
C...Scalars in common
INTEGER
%26amp; NTEST
C...Local scalars
REAL (KIND=R8)
%26amp; TSTFAC
INTEGER
%26amp; LUNERR,LUNRPT,LUNSUM
LOGICAL
%26amp; PASSED
C...External subroutines
EXTERNAL
%26amp; DODRX
C...Common blocks
COMMON /TSTSET/ NTEST
C***Variable declarations (alphabetically)
C LUNERR: The logical unit number used for error messages.
C LUNRPT: The logical unit number used for computation reports.
C LUNSUM: The logical unit number used for a summary report listing
C only the test comparisons and not the odrpack generated
C reports.
C NTEST: The number of tests to be run.
C PASSED: The variable designating whether the results of all of the
C tests agree with those from the cray ymp using double
C precision (PASSED=TRUE), or whether some of the results
C disagreed (PASSED=FALSE).
C TSTFAC: The user-supplied factor for scaling the test tolerances
C used to check for agreement between computed results and
C results obtained using REAL (KIND=R8) version on cray
C YMP. Values of TSTFAC greater than one increase the
C test tolerances, making the tests easier to pass and
C allowing small discrepancies between the computed and
C expected results to be automatically discounted.
C***First executable statement TEST
C Set up necessary files
C NOTE: ODRPACK95 generates computation and error reports on
C logical unit 6 by default;
C logical unit 'LUNSUM' used to summarize results of comparisons
C from exercise routine DODRX.
LUNRPT = 18
LUNERR = 18
LUNSUM = 19
OPEN(UNIT=LUNRPT,FILE='REPORT')
OPEN(UNIT=LUNERR,FILE='REPORT')
OPEN(UNIT=LUNSUM,FILE='SUMMARY')
C Exercise REAL (KIND=R8) version of ODRPACK95
C (test reports generated on file 'RESULTS' and
C summarized in file 'SUMMARY')
NTEST = 23
TSTFAC = 1.0E0_R8
CALL DODRX(TSTFAC,PASSED,LUNSUM)
END
*DODRX
SUBROUTINE DODRX
%26amp; (TSTFAC,PASSED,LUNSUM)
C***Begin Prologue DODRX
C***Refer to ODR
C***Routines Called DDOT,DNRM2,ODR,DODRXD,
C DODRXF,DODRXW,DWGHT,DZERO
C***Date Written 860529 (YYMMDD)
C***Revision Date 920619 (YYMMDD)
C***Purpose Exercise features of ODRPACK95 software
C***End Prologue DODRX
C...Used modules
USE ODRPACK95
USE REAL_PRECISION
C...Parameters
INTEGER
%26amp; LDWD,LDWE,LD2WD,LD2WE,LIWORK,LWORK,MAXN,...
REAL (KIND=R8)
%26amp; BASE
PARAMETER
%26amp; (MAXN=50, MAXM=3, MAXNP=10, MAXNQ=2, NTESTS=23,
%26amp; LDWE=MAXN, LD2WE=MAXNQ, LDWD=MAXN, LD2WD=MAXM,
%26amp; LWORK = 18 + 11*MAXNP + MAXNP**2 + MAXM + MAXM**2 +
%26amp; 4*MAXN*MAXNQ + 6*MAXN*MAXM + 2*MAXN*MAXNQ*MAXNP +
%26amp; 2*MAXN*MAXNQ*MAXM + MAXNQ**2 +
%26amp; 5*MAXNQ + MAXNQ*(MAXNP+MAXM) + LDWE*LD2WE*MAXNQ,
%26amp; LIWORK = 20+MAXNP+MAXNQ*(MAXNP+MAXM),
%26amp; BASE = RADIX(1.0E0_R8))
C...Scalar arguments
REAL (KIND=R8)
%26amp; TSTFAC
INTEGER
%26amp; LUNSUM
LOGICAL
%26amp; PASSED
C...Scalars in common
INTEGER
%26amp; NTEST,SETNO
C...Local scalars
INTEGER
%26amp; I,INFO,IPRINT,ITEST,JOB,L,LDIFX,LDSCLD,L...
%26amp; LDX,LDY,LD2WD1,LD2WE1,LIWMIN,LUN,LUNERR,...
%26amp; M,MAXIT,MSG,N,NDIGIT,NP,NQ
REAL (KIND=R8)
%26amp; BNRM,EPSMAC,EWRT,EWRT2,HUNDRD,ONE,P01,P2...
%26amp; TAUFAC,THREE,TSTTOL,TWO,WSS,WSSDEL,WSSEP...
LOGICAL
%26amp; FAILED,FAILS,ISODR,SHORT
CHARACTER TITLE*80
C...Arrays in common
REAL (KIND=R8)
%26amp; LOWER(MAXNP),UPPER(MAXNP)
C...Local arrays
REAL (KIND=R8)
%26amp; BETA(MAXNP),DELTA(:,:),DPYMP(2,NTESTS),
%26amp; SCLB(MAXNP),SCLD(MAXN,MAXM),
%26amp; STPB(MAXNP),STPD(MAXN,MAXM),
%26amp; WE(MAXN,MAXNQ,MAXNQ),WD(MAXN,MAXM,MAXM),...
%26amp; WRK(MAXN*MAXM+MAXN*MAXNQ),X(MAXN,MAXM),Y...
%26amp; TEMPRETL(MAXN,MAXM)
INTEGER
%26amp; IDPYMP(NTESTS),IFIXB(MAXNP),IFIXX(MAXN,M...
C...Pointers
POINTER
%26amp; DELTA,IWORK,WORK
C...External functions
REAL (KIND=R8)
%26amp; DDOT,DNRM2
EXTERNAL
%26amp; DDOT,DNRM2
C...External subroutines
EXTERNAL
%26amp; DODRXD,DODRXF,DODRXW,DZERO
C...Intrinsic functions
INTRINSIC
%26amp; ABS,MOD
C...Common blocks
COMMON /SETID/SETNO
COMMON /TSTSET/ NTEST
COMMON /BOUNDS/ LOWER,UPPER
C...Data statements
DATA
%26amp; ZERO,P01,P2,ONE,TWO,THREE,HUNDRD
%26amp; /0.0E0_R8,0.01E0_R8,0.2E0_R8,1.0E0_R8,2....
%26amp; 100.0E0_R8/
DATA
%26amp; (DPYMP(I,1),I=1,2)
%26amp; /2.762733195780256808978449342964E+04_R8...
%26amp; 7.532639569022918943695104672512E-04_R8/
DATA
%26amp; (DPYMP(I,2),I=1,2)
%26amp; /2.762732630143673024399942947263E+04_R8...
%26amp; 7.538467722687131506874279314940E-04_R8/
DATA
%26amp; (DPYMP(I,3),I=1,2)
%26amp; /1.069944100000000027940905194068E+09_R8...
%26amp; 1.212808593256056359629660672046E-05_R8/
DATA
%26amp; (DPYMP(I,4),I=1,2)
%26amp; /1.069944100000000026623461142867E+09_R8...
%26amp; 5.452084633790606017572015067556E-07_R8/
DATA
%26amp; (DPYMP(I,5),I=1,2)
%26amp; /1.426988156377258617521571734503E+00_R8...
%26amp; 1.084728687127432219753903919409E+00_R8/
DATA
%26amp; (DPYMP(I,6),I=1,2)
%26amp; /4.261321829513978871872508874025E+00_R8...
%26amp; 1.477967210398420733565424329280E-02_R8/
DATA
%26amp; (DPYMP(I,7),I=1,2)
%26amp; /4.261272307142888464011486769858E+00_R8...
%26amp; 1.477966125465374336804138554559E-02_R8/
DATA
%26amp; (DPYMP(I,8),I=1,2)
%26amp; /4.371487317909745009110272283622E+01_R8...
%26amp; 1.144419474408286067112233592550E-03_R8/
DATA
%26amp; (DPYMP(I,9),I=1,2)
%26amp; /3.099048849376848610380977303924E+00_R8...
%26amp; 8.824708863783850023783338218501E-02_R8/
DATA
%26amp; (DPYMP(I,10),I=1,2)
%26amp; /9.469917836739932584221023234527E+00_R8...
%26amp; 4.205389215588104651198536809880E-01_R8/
DATA
%26amp; (DPYMP(I,11),I=1,2)
%26amp; /3.950949253027682207109233363651E+01_R8...
%26amp; 6.651838750834910819636881506915E+01_R8/
DATA
%26amp; (DPYMP(I,12),I=1,2)
%26amp; /3.950949253027682207109233363651E+01_R8...
%26amp; 6.651838750834910819636881506915E+01_R8/
DATA
%26amp; (DPYMP(I,13),I=1,2)
%26amp; /1.414213562373095000000000000000E+00_R8...
%26amp; 5.250825926608277346013642256883E-26_R8/
DATA
%26amp; (DPYMP(I,14),I=1,2)
%26amp; /1.414213562373095000000000000000E+00_R8...
%26amp; 8.159081600696301507018019048968E-26_R8/
DATA
%26amp; (DPYMP(I,15),I=1,2)
%26amp; /1.486588477064952451556223422813E+00_R8...
%26amp; 1.841690442255357083922717720270E+03_R8/
DATA
%26amp; (DPYMP(I,16),I=1,2)
%26amp; /2.001224625073357401561224833131E+02_R8...
%26amp; 0.000000000000000000000000000000E+00_R8/
DATA
%26amp; (DPYMP(I,17),I=1,2)
%26amp; /2.000099997500125000000000000000E+02_R8...
%26amp; 0.000000000000000000000000000000E+00_R8/
DATA
%26amp; (DPYMP(I,18),I=1,2)
%26amp; /1.414213562373095000000000000000E+00_R8...
%26amp; 5.816277809383742531415846947805E-26_R8/
DATA
%26amp; (DPYMP(I,19),I=1,2)
%26amp; /2.000624902374255782433465356007E+02_R8...
%26amp; 4.568236947482152283374593507328E+30_R8/
Can any one help me by provideing c language study material?
can any one help me by provideing c language study material
any web sites ......or any study material .....or any material in mail....just u can send me to my mail id work1hours@yahoo.com
i will be glad if u do this favour
Can any one help me by provideing c language study material?
Your local university library should have lots of this type of material.
Providing doesn't have an e.
any web sites ......or any study material .....or any material in mail....just u can send me to my mail id work1hours@yahoo.com
i will be glad if u do this favour
Can any one help me by provideing c language study material?
Your local university library should have lots of this type of material.
Providing doesn't have an e.
Can any one give me a link to prepare an encyclopedia in c or c++ programing language?
i have to do a project in c and c++ language.i thought of creating a encyclopedia using c and c++ languages only.so can any body provide me with the link or the programe?
Can any one give me a link to prepare an encyclopedia in c or c++ programing language?
Are you planning to create encyclopedia software from scratch such as Wikipedia? Tikiwiki is C++ open source software that will do the job for you.
Reply:LINKS WILL BE OF NO USE.
BUY A SERIES OF BOOKS "THE C ODYSSEY"
brenda song
Can any one give me a link to prepare an encyclopedia in c or c++ programing language?
Are you planning to create encyclopedia software from scratch such as Wikipedia? Tikiwiki is C++ open source software that will do the job for you.
Reply:LINKS WILL BE OF NO USE.
BUY A SERIES OF BOOKS "THE C ODYSSEY"
brenda song
How do i save big integer numbers in "C" Language?
How do i save big integer numbers in "C" Language?
hi all,
i want to save student ID "10 Digits each" on vars
but the problem if i use integer vars , its limited to 32768 and can't hold a number from 10 digits !!
what can i do ?
any help would be great.
thanks all at least for trying =)
all i want to do is to read an id from the user with scanf function and to put it in a var... thats all
* 5 hours ago
* - 3 days left to answer.
Additional Details
5 hours ago
thanks for the idea,,,
but can you please explain more about the LONG INT ?..
how exactly to use it,,,
whats the limits of long int...
and if u can type simple small program to read IDS from users and put them in long integers...
thanks again
5 hours ago
Using a numerical type will make it impossible to effectively hold student IDs that have leading 0s.
Yes thats right,, then how i can read 10 different ids and to sort them from small to big,,, or something like that,,
thats exactly wt makes me crazy
How do i save big integer numbers in "C" Language?
The previous recommendations to use a char array for your IDs, and sort the IDs after you've collected them, are good suggestions. I wrote the code below to illustrate a way to do this, with a few extra features:
IDs can be entered 1 or more per line, separated by commas, tabs, or spaces.
IDs shorter than 10 charcters will be padded with leading zeros.
IDs longer than 10 characters will be truncated.
Entered IDs are inserted into a linked list in alphabetical order.
A feature you could add: check for duplicate entries, reject them and display an error message.
Enjoy!
#include %26lt;stdio.h%26gt;
#include %26lt;string.h%26gt;
#include %26lt;stdlib.h%26gt;
#define MAX_LINE 80
#define ID_LEN 10
#define WS " ,\t"
struct IdListNode_t {
int len;
char *id;
struct IdListNode_t *next;
};
typedef enum { false = 0, true } Bool;
typedef struct IdListNode_t *IdList_t;
IdList_t newIdList();
void idListInsert(IdList_t, char *);
void printIdList(IdList_t);
void deleteIdList(IdList_t);
int main(int argc, char *argv[]) {
char line[MAX_LINE],*s;
char id[ID_LEN];
IdList_t idList = newIdList();
Bool done = false;
printf("\nEnter ids (one or more per line, empty line to quit):\n");
while (done == false) {
fgets(line,MAX_LINE,stdin);
*strchr(line,'\n') = '\0';
if ((done = (strlen(line) == 0)) == false) {
for (s = strtok(line,WS); s != NULL; s = strtok(NULL,WS)) {
if (strlen(s) %26lt;= ID_LEN) {
memset(id,'0',ID_LEN);
strcpy(id + ID_LEN - strlen(s),s);
} else {
strncpy(id,s,ID_LEN);
}
idListInsert(idList,id);
}
}
}
printIdList(idList);
deleteIdList(idList);
return 0;
}
IdList_t newIdList() {
return calloc(1,sizeof(struct IdListNode_t));
}
void idListInsert(IdList_t l, char *s) {
struct IdListNode_t *p = l;
struct IdListNode_t *n = calloc(1,sizeof(struct IdListNode_t));
n-%26gt;len = strlen(s);
n-%26gt;id = malloc(n-%26gt;len);
strcpy(n-%26gt;id,s);
while ((p-%26gt;next != NULL) %26amp;%26amp;
(strcmp(n-%26gt;id,p-%26gt;next-%26gt;id) %26gt; 0)) {
p = p-%26gt;next;
}
n-%26gt;next = p-%26gt;next;
p-%26gt;next = n;
}
void printIdList(IdList_t l) {
struct IdListNode_t *p = l-%26gt;next;
while (p != NULL) {
printf("|%s|\n",p-%26gt;id);
p = p-%26gt;next;
}
}
void deleteIdList(IdList_t l) {
struct IdListNode_t *p = l;
while (p != NULL) {
struct IdListNode_t *next = p-%26gt;next;
free(p-%26gt;id);
free(p);
p = next;
}
}
Reply:the primitive type 'long' will happily store any 10 digit number, however you will have problems storing ids starting with 0.
My recommendation is to just use a string (character array)
rough example:
char student_id[10];
scanf("%s", student_id);
Then use any regular sorting algorithm to sort the results.
hi all,
i want to save student ID "10 Digits each" on vars
but the problem if i use integer vars , its limited to 32768 and can't hold a number from 10 digits !!
what can i do ?
any help would be great.
thanks all at least for trying =)
all i want to do is to read an id from the user with scanf function and to put it in a var... thats all
* 5 hours ago
* - 3 days left to answer.
Additional Details
5 hours ago
thanks for the idea,,,
but can you please explain more about the LONG INT ?..
how exactly to use it,,,
whats the limits of long int...
and if u can type simple small program to read IDS from users and put them in long integers...
thanks again
5 hours ago
Using a numerical type will make it impossible to effectively hold student IDs that have leading 0s.
Yes thats right,, then how i can read 10 different ids and to sort them from small to big,,, or something like that,,
thats exactly wt makes me crazy
How do i save big integer numbers in "C" Language?
The previous recommendations to use a char array for your IDs, and sort the IDs after you've collected them, are good suggestions. I wrote the code below to illustrate a way to do this, with a few extra features:
IDs can be entered 1 or more per line, separated by commas, tabs, or spaces.
IDs shorter than 10 charcters will be padded with leading zeros.
IDs longer than 10 characters will be truncated.
Entered IDs are inserted into a linked list in alphabetical order.
A feature you could add: check for duplicate entries, reject them and display an error message.
Enjoy!
#include %26lt;stdio.h%26gt;
#include %26lt;string.h%26gt;
#include %26lt;stdlib.h%26gt;
#define MAX_LINE 80
#define ID_LEN 10
#define WS " ,\t"
struct IdListNode_t {
int len;
char *id;
struct IdListNode_t *next;
};
typedef enum { false = 0, true } Bool;
typedef struct IdListNode_t *IdList_t;
IdList_t newIdList();
void idListInsert(IdList_t, char *);
void printIdList(IdList_t);
void deleteIdList(IdList_t);
int main(int argc, char *argv[]) {
char line[MAX_LINE],*s;
char id[ID_LEN];
IdList_t idList = newIdList();
Bool done = false;
printf("\nEnter ids (one or more per line, empty line to quit):\n");
while (done == false) {
fgets(line,MAX_LINE,stdin);
*strchr(line,'\n') = '\0';
if ((done = (strlen(line) == 0)) == false) {
for (s = strtok(line,WS); s != NULL; s = strtok(NULL,WS)) {
if (strlen(s) %26lt;= ID_LEN) {
memset(id,'0',ID_LEN);
strcpy(id + ID_LEN - strlen(s),s);
} else {
strncpy(id,s,ID_LEN);
}
idListInsert(idList,id);
}
}
}
printIdList(idList);
deleteIdList(idList);
return 0;
}
IdList_t newIdList() {
return calloc(1,sizeof(struct IdListNode_t));
}
void idListInsert(IdList_t l, char *s) {
struct IdListNode_t *p = l;
struct IdListNode_t *n = calloc(1,sizeof(struct IdListNode_t));
n-%26gt;len = strlen(s);
n-%26gt;id = malloc(n-%26gt;len);
strcpy(n-%26gt;id,s);
while ((p-%26gt;next != NULL) %26amp;%26amp;
(strcmp(n-%26gt;id,p-%26gt;next-%26gt;id) %26gt; 0)) {
p = p-%26gt;next;
}
n-%26gt;next = p-%26gt;next;
p-%26gt;next = n;
}
void printIdList(IdList_t l) {
struct IdListNode_t *p = l-%26gt;next;
while (p != NULL) {
printf("|%s|\n",p-%26gt;id);
p = p-%26gt;next;
}
}
void deleteIdList(IdList_t l) {
struct IdListNode_t *p = l;
while (p != NULL) {
struct IdListNode_t *next = p-%26gt;next;
free(p-%26gt;id);
free(p);
p = next;
}
}
Reply:the primitive type 'long' will happily store any 10 digit number, however you will have problems storing ids starting with 0.
My recommendation is to just use a string (character array)
rough example:
char student_id[10];
scanf("%s", student_id);
Then use any regular sorting algorithm to sort the results.
Hi, i m getting "Array Bound Read" in C language for perticular file that is written in C.i m using memcpy().
I m getting "Array Bound Read" error while usign memcpy () in C language.
can u plz tell me why this err is coming and How can we solve these kind of errors.
That err is displaying while i m chcking through Rational Purifier s/w.
please let me know how we can resolve this err.ASAP
Thanks and Regards,
Sharique
Hi, i m getting "Array Bound Read" in C language for perticular file that is written in C.i m using memcpy().
It means, you have crossed array boundary and try to read from another memory block.
Validate your memcpy() parameters.
can u plz tell me why this err is coming and How can we solve these kind of errors.
That err is displaying while i m chcking through Rational Purifier s/w.
please let me know how we can resolve this err.ASAP
Thanks and Regards,
Sharique
Hi, i m getting "Array Bound Read" in C language for perticular file that is written in C.i m using memcpy().
It means, you have crossed array boundary and try to read from another memory block.
Validate your memcpy() parameters.
From where i can find and download free c++ language and compiler and related materials?
my son is studing in 10th std and wants to learn c++ for that i want the language and i also want to create some programmes on this language
From where i can find and download free c++ language and compiler and related materials?
There is a lot stuff related to C++. It's also becoming outed as an old code. I think you'd have better success trying a used book store.
The links below may be helpful.
Reply:http://www.bloodshed.net/devcpp.html
free C++ compiler and stuff
Reply:try this it is the express edition of MS C++ (and it's free!!)
From where i can find and download free c++ language and compiler and related materials?
There is a lot stuff related to C++. It's also becoming outed as an old code. I think you'd have better success trying a used book store.
The links below may be helpful.
Reply:http://www.bloodshed.net/devcpp.html
free C++ compiler and stuff
Reply:try this it is the express edition of MS C++ (and it's free!!)
Can any one tell where can i get free online classes on c language?
can any one tell where can i get free online classes on c language ...or pls tell me some nice web sites which provide total help and material regarding c language....pls i need ur help so much pls
c language learning material ...programs, flow charts , diagrams every thing each and every thing
if u have it in mail pls u can even forword it to me
my id is work1hours@yahoo.com
Can any one tell where can i get free online classes on c language?
http://www.google.com/search?hl=en%26amp;q=fre...
bouquet
c language learning material ...programs, flow charts , diagrams every thing each and every thing
if u have it in mail pls u can even forword it to me
my id is work1hours@yahoo.com
Can any one tell where can i get free online classes on c language?
http://www.google.com/search?hl=en%26amp;q=fre...
bouquet
Question about "int main(int argc, char *argv[])" in the C language?
I'm trying to help out a friend out understanding the C language for a class. I personally understand C++, never worked with C. His problem is that he has to write a program that gets a loop count from the command line, and then writes the process ID for each loop as it runs. We've made some progress with understanding other parts of how C works, but we aren't getting this argc and argv[] part. I know what they are, but not how to properly use them. Here is the code that he was given to start with:
#include %26lt;sys/types.h%26gt;
#include %26lt;unistd.h%26gt;
int main(int argc, char *argv[]) {
int count;
if (argc == 2)
count = atoi(argv[1]);
else
count = 10;
pid_t getpid(void);
}
=======================
Any help is greatly appreciated. I just need to understand how to use these parameters, then I should be able to use them properly in the code, and help him out... Thanks...
Question about "int main(int argc, char *argv[])" in the C language?
It looks like you are on the right track, and given the other answer you know what the parameters are and how they are used.
Im confused with how you are compiling and running your programme. The one you gave in the question should not put out any information. As a simple test, change your programme slightly to verify what you are finding on the command line:
include %26lt;sys/types.h%26gt;
#include %26lt;unistd.h%26gt;
int main(int argc, char *argv[]) {
int count;
int pid;
if (argc == 2)
count = atoi(argv[1]);
else
count = 10;
pid = getpid();
printf( "count=%d pid%d\n", count, pid );
}
=============
Just to make sure you are on the right track with compilation, if your programme is in prog.c try these commands:
gcc prog.c
a.out 6
Im assuming you have gcc, otherwise the command will be cc to compile and link. By default the output is a file called a.out and that is executable from the command line. If this worked, then you should see count=6 and pid=xxxxxx on the screen.
Hope this gets you a bit further.
Reply:When the application starts the command line is parsed and passed to the main function. The argc is the integer count of the parameters passed and argv is an array of char * that points to the string data containing each of the command line arguments. When parsed argv[0] equals the name of the application that was executed and argv[1..n] is each of the command line parameters.
#include %26lt;sys/types.h%26gt;
#include %26lt;unistd.h%26gt;
int main(int argc, char *argv[]) {
int count;
if (argc == 2)
count = atoi(argv[1]);
else
count = 10;
pid_t getpid(void);
}
=======================
Any help is greatly appreciated. I just need to understand how to use these parameters, then I should be able to use them properly in the code, and help him out... Thanks...
Question about "int main(int argc, char *argv[])" in the C language?
It looks like you are on the right track, and given the other answer you know what the parameters are and how they are used.
Im confused with how you are compiling and running your programme. The one you gave in the question should not put out any information. As a simple test, change your programme slightly to verify what you are finding on the command line:
include %26lt;sys/types.h%26gt;
#include %26lt;unistd.h%26gt;
int main(int argc, char *argv[]) {
int count;
int pid;
if (argc == 2)
count = atoi(argv[1]);
else
count = 10;
pid = getpid();
printf( "count=%d pid%d\n", count, pid );
}
=============
Just to make sure you are on the right track with compilation, if your programme is in prog.c try these commands:
gcc prog.c
a.out 6
Im assuming you have gcc, otherwise the command will be cc to compile and link. By default the output is a file called a.out and that is executable from the command line. If this worked, then you should see count=6 and pid=xxxxxx on the screen.
Hope this gets you a bit further.
Reply:When the application starts the command line is parsed and passed to the main function. The argc is the integer count of the parameters passed and argv is an array of char * that points to the string data containing each of the command line arguments. When parsed argv[0] equals the name of the application that was executed and argv[1..n] is each of the command line parameters.
Please write this one too in C prgramming language!?
using conditional operator,find whether the number is completely divisible by 10!can u tell me whether i can learn C-language online by myself!
Please write this one too in C prgramming language!?
again really easy:
int divisibility = (m % 10) == 0) ? 1 : 0;
But I think it is better you learn it yourself. Try a book that would be better. Just search C language tutorials.
Reply:int main(){
int n;
cout%26lt;%26lt;"n= "; cin%26gt;%26gt;n;
if (n%10==0) cout%26lt;%26lt;"n is divisible by 10"
else cout%26lt;%26lt;"n is not divisible by 10"
return 0;
}
Now, for learning C/C++ I recommend you a very good book named "Thinking in C++". It has two volumes and it's already at the 3-rd edition. It's free to download! More info you'll find at this link!
Reply:this is professional:
int divisibility = (m % 10) == 0) ? 1 : 0;
but if you dont know about ? you can use it:
int divisibility;
if((m % 10)==0) divisibility=1;
else divisibility=0;
about learn c i suggest you use forums ;)
Please write this one too in C prgramming language!?
again really easy:
int divisibility = (m % 10) == 0) ? 1 : 0;
But I think it is better you learn it yourself. Try a book that would be better. Just search C language tutorials.
Reply:int main(){
int n;
cout%26lt;%26lt;"n= "; cin%26gt;%26gt;n;
if (n%10==0) cout%26lt;%26lt;"n is divisible by 10"
else cout%26lt;%26lt;"n is not divisible by 10"
return 0;
}
Now, for learning C/C++ I recommend you a very good book named "Thinking in C++". It has two volumes and it's already at the 3-rd edition. It's free to download! More info you'll find at this link!
Reply:this is professional:
int divisibility = (m % 10) == 0) ? 1 : 0;
but if you dont know about ? you can use it:
int divisibility;
if((m % 10)==0) divisibility=1;
else divisibility=0;
about learn c i suggest you use forums ;)
I would like learn computer basics along with c and c++ language for free in online or by books.?
as i am poor i cant get computer education so i would like to recieve free books of computer of computer basics along with c and c++ language.plz send me datails does any 1 knows about this.kindly waiting for ur response.thnx
I would like learn computer basics along with c and c++ language for free in online or by books.?
If you are going to learn C, you need the C programmers bible.
K%26amp;R - The C programming Language:
http://www.amazon.com/C-Programming-Lang...
I don't know any programmer worth their salt that does not have this book on their shelf. At the very least, check this out from the library (or have a look-see while you are at Barnes %26amp; Noble).
However, if you are insistent on learning from the internet, here is a good link for free programming books:
http://www.freetechbooks.com/
Reply:I'm thinking you aren't going to get anything meaningful for free.
Reply:http://www.learnthat.com/courses/compute...
http://www.fgcu.edu/support/office2000/w...
http://www.thefreecountry.com/documentat...
The Fgcu is a very good site, many of my friends have used it too,
Just a piece of advice, NEVER SAY YOU ARE POOR, because you become what you think....THINK RICH and you will be rich...
you should check out the following site..
www.secret.com
Good luck with everything you...THINK POSITIVE...
I would like learn computer basics along with c and c++ language for free in online or by books.?
If you are going to learn C, you need the C programmers bible.
K%26amp;R - The C programming Language:
http://www.amazon.com/C-Programming-Lang...
I don't know any programmer worth their salt that does not have this book on their shelf. At the very least, check this out from the library (or have a look-see while you are at Barnes %26amp; Noble).
However, if you are insistent on learning from the internet, here is a good link for free programming books:
http://www.freetechbooks.com/
Reply:I'm thinking you aren't going to get anything meaningful for free.
Reply:http://www.learnthat.com/courses/compute...
http://www.fgcu.edu/support/office2000/w...
http://www.thefreecountry.com/documentat...
The Fgcu is a very good site, many of my friends have used it too,
Just a piece of advice, NEVER SAY YOU ARE POOR, because you become what you think....THINK RICH and you will be rich...
you should check out the following site..
www.secret.com
Good luck with everything you...THINK POSITIVE...
How Can I Download C Language ?
i want to Download C Programming Language thru internet on my PC!! anyone can get me some Link to download thru??
How Can I Download C Language ?
Try here:
Reply:You could try this site. It has free compilers including c/c++
http://www.thefreecountry.com/compilers/...
C Compilers can be found an downloaded for Linux/Windows operating systems.
Good luck
(Alternatively, if you are looking for c# or c++, Microsoft Offers Visual Studio Express versions of both of these at the following url: http://msdn.microsoft.com/vstudio/expres... )
Reply:u can purchase the installer from the market or mail me
Reply:You do not download the C language. You can write C programs on notepad or wordpad. What you need is a compiler to complete the program once it is written.
Reply:You don't download C explicitly. You need to download a development environment that allows you to write and compile C programs.
if you are good with your own editor and running commands from a DOS or Linux shell, you should download GCC from gnu.org.
http://gcc.gnu.org/
if you;re more inclined to have a project space and use a GUI, try out Microsofts Visual C++, which will also compile plain old C.
http://msdn.microsoft.com/vstudio/expres...
Reply:well, i'm using visual studio.net for c/c++
visual studio 6.0 also available
yu gi oh cards
How Can I Download C Language ?
Try here:
Reply:You could try this site. It has free compilers including c/c++
http://www.thefreecountry.com/compilers/...
C Compilers can be found an downloaded for Linux/Windows operating systems.
Good luck
(Alternatively, if you are looking for c# or c++, Microsoft Offers Visual Studio Express versions of both of these at the following url: http://msdn.microsoft.com/vstudio/expres... )
Reply:u can purchase the installer from the market or mail me
Reply:You do not download the C language. You can write C programs on notepad or wordpad. What you need is a compiler to complete the program once it is written.
Reply:You don't download C explicitly. You need to download a development environment that allows you to write and compile C programs.
if you are good with your own editor and running commands from a DOS or Linux shell, you should download GCC from gnu.org.
http://gcc.gnu.org/
if you;re more inclined to have a project space and use a GUI, try out Microsofts Visual C++, which will also compile plain old C.
http://msdn.microsoft.com/vstudio/expres...
Reply:well, i'm using visual studio.net for c/c++
visual studio 6.0 also available
yu gi oh cards
ACM Contest Program Solutions (C Language)?
Can anyone tell me a good website/forum/blog which has solutions for ACM programming contest problems using C programming Language??
ACM Contest Program Solutions (C Language)?
Check out Steven Halim's site:
www.comp.nus.edu.sg/~stevenha/programm...
ACM Contest Program Solutions (C Language)?
Check out Steven Halim's site:
www.comp.nus.edu.sg/~stevenha/programm...
I need a compiler for the C language!?
Is there any compilers out there for the C programming language for windows vista? Any help will be appreciated!
I need a compiler for the C language!?
Google is God.
Scroll down to "Free compilers"
http://www.cpax.org.uk/prg/portable/c/re...
Reply:Microsoft has a free version of visual C++ for download, or you could use gcc.
Reply:If you run a search one of the first links you will find is:
http://www.thefreecountry.com/compilers/...
You don't need to go any further.
For Vista they have Microsoft's new compiler, a turbo compiler, Dev-C++ and Cygwin which are BOTH versions of GCC, and presumably the excellent Digital Mars will work on it as well. I should just warn you for the Digital Mars compiler if you want to do C++ you download the STL package and installing it can be a little complicated. Before I jumped from Windows to Linux I was using it, but I created a short .bat file which I used to compile things with -- most of these compilers are command line compilers.
Reply:C is a subset of C++. Just don't use the advanced features and study the differences.
I need a compiler for the C language!?
Google is God.
Scroll down to "Free compilers"
http://www.cpax.org.uk/prg/portable/c/re...
Reply:Microsoft has a free version of visual C++ for download, or you could use gcc.
Reply:If you run a search one of the first links you will find is:
http://www.thefreecountry.com/compilers/...
You don't need to go any further.
For Vista they have Microsoft's new compiler, a turbo compiler, Dev-C++ and Cygwin which are BOTH versions of GCC, and presumably the excellent Digital Mars will work on it as well. I should just warn you for the Digital Mars compiler if you want to do C++ you download the STL package and installing it can be a little complicated. Before I jumped from Windows to Linux I was using it, but I created a short .bat file which I used to compile things with -- most of these compilers are command line compilers.
Reply:C is a subset of C++. Just don't use the advanced features and study the differences.
How to write this programe in Turbo C language?
Plz use Turbo C language instead of C++.And have to use for loops etc in this program.use stdio.h n conio.h only n use
printf() etc.................
........1
......121
....12321
..1234321
123454321
..1234321
....12321
......121
........1
How to write this programe in Turbo C language?
#include %26lt;stdio.h%26gt;
int main(void)
{
int i, w = 5, dx = 1;
for (i = 1; i %26gt;= 1; i += dx)
{
int pad;
if (i == w) dx = -1;
for (pad = w; pad %26gt; i; --pad)
putchar(' ');
for (pad = 1; pad %26lt;= i; ++pad)
putchar('0' + pad); /* This line prints eg: 1234 */
for (pad = i - 1; pad %26gt;= 1; --pad)
putchar('0' + pad); /* This line prints eg: 321 */
putchar('\n');
}
return 0;
}
printf() etc.................
........1
......121
....12321
..1234321
123454321
..1234321
....12321
......121
........1
How to write this programe in Turbo C language?
#include %26lt;stdio.h%26gt;
int main(void)
{
int i, w = 5, dx = 1;
for (i = 1; i %26gt;= 1; i += dx)
{
int pad;
if (i == w) dx = -1;
for (pad = w; pad %26gt; i; --pad)
putchar(' ');
for (pad = 1; pad %26lt;= i; ++pad)
putchar('0' + pad); /* This line prints eg: 1234 */
for (pad = i - 1; pad %26gt;= 1; --pad)
putchar('0' + pad); /* This line prints eg: 321 */
putchar('\n');
}
return 0;
}
What is meant by preprocessor in "c language"?
it is about the "c language".
What is meant by preprocessor in "c language"?
It is a program that preprocess the source code before it is passed to the compiler.There r different kind of preprocessor command or directive like macro expansion, file inclusion,conditional compilation etc...
Reply:The preprocessor is one of the four tools that a compiler suite needs to compile your source code.
Being executed as first, the preprocessor looks in the source code for C macros and substitutes them against the corresponding code.
You can recognize those macros by the # in front of the keyword (#include, #pragma, #define, #ifdef, ...)
thank you cards
What is meant by preprocessor in "c language"?
It is a program that preprocess the source code before it is passed to the compiler.There r different kind of preprocessor command or directive like macro expansion, file inclusion,conditional compilation etc...
Reply:The preprocessor is one of the four tools that a compiler suite needs to compile your source code.
Being executed as first, the preprocessor looks in the source code for C macros and substitutes them against the corresponding code.
You can recognize those macros by the # in front of the keyword (#include, #pragma, #define, #ifdef, ...)
thank you cards
How to write this programe in Turbo C language?
Plz use Turbo C language instead of C++.And have to use for loops etc in this program.use stdio.h n conio.h only n use
printf() etc.................
........1
......121
....12321
..1234321
123454321
..1234321
....12321
......121
........1
How to write this programe in Turbo C language?
#include %26lt;stdio.h%26gt;
int main(void)
{
int i, w = 5, dx = 1;
for (i = 1; i %26gt;= 1; i += dx)
{
int pad;
if (i == w) dx = -1;
for (pad = w; pad %26gt; i; --pad)
putchar(' ');
for (pad = 1; pad %26lt;= i; ++pad)
putchar('0' + pad); /* This line prints eg: 1234 */
for (pad = i - 1; pad %26gt;= 1; --pad)
putchar('0' + pad); /* This line prints eg: 321 */
putchar('\n');
}
return 0;
}
printf() etc.................
........1
......121
....12321
..1234321
123454321
..1234321
....12321
......121
........1
How to write this programe in Turbo C language?
#include %26lt;stdio.h%26gt;
int main(void)
{
int i, w = 5, dx = 1;
for (i = 1; i %26gt;= 1; i += dx)
{
int pad;
if (i == w) dx = -1;
for (pad = w; pad %26gt; i; --pad)
putchar(' ');
for (pad = 1; pad %26lt;= i; ++pad)
putchar('0' + pad); /* This line prints eg: 1234 */
for (pad = i - 1; pad %26gt;= 1; --pad)
putchar('0' + pad); /* This line prints eg: 321 */
putchar('\n');
}
return 0;
}
Anyone can help me to make a "C language" program?
1. To convert hexadecimal to decimal
Suppose the input is :"4FDA12"
And the output should be:"5233170"
Suppose the input is :"F"
And the output is:"15"
2. To convert decimal to hexadecimal
Suppuse the input is "5233170"
And the output is "4FDA12"
Suppose the input is "15"
And the output is "F"
Please let me know how it work and how is the algorithm. I try to make it for 3 days but i confuse. I have a problem with how we save tomporaty the number and the counter to count how many digit is the output.
I still learn C language and i dont understand C++
Could someone please explain me and help me to build the 2 programs. I need the source code to improve my Algorithm skill.
:)
Thanks for ur help.
Good luck. Have a nice weekend..
Anyone can help me to make a "C language" program?
Just use strtoul to convert from string to integer, and sprintf
to convert from an interger back to a string.
Example 1:
val = strtoul(hexstr, NULL, 16); /* hex string to interger */
Example 2:
val = strtoul(decstr, NULL, 10); /* dec string to integer */
Example 3:
sprintf(hexstr, "%X", val); /* integer to hex string */
Example 4:
sprintf(decstr, "%d", val); /* integer to dec string */
If you're doing this for a class, then the instructor might have told
you that you are not allowed to use functions like strtoul and sprintf to do the conversion. In that case, you can do something like this...
// the dots at the beginning of each line are there because
// yahoo removes leading spaces
unsigned int hexstr2uint(char *hexstr)
{
. . unsigned int val = 0;
. . int temp;
. .
. . if (hexstr != NULL)
. . . . for( ; *hexstr ; hexstr++)
. . . . {
. . . . . . temp = hexchr2int( *hexstr );
. . . . . . if (temp == -1) /* stop if we reach an invalid char */
. . . . . . . . break;
.
. . . . . . val *= 16;
. . . . . . val += (unsigned int) temp;
. . . . }
.
. . return val;
}
You should be able to write the hexchr2int function, and
the decstr2uint function will be similar to the one I've shown
above.
To convert an integer to a string w/o using standard C functions...
char *uint2hexstr(unsigned int val, char *outbuf)
{
. . int digits[32], ndigits = 0, i = 0 ;
.
. . do
. . {
. . . . digits [ ndigits++ ] = val % 16;
. . . . val /= 16;
. . }
. . while(val %26gt; 0);
.
. . for ( i = 0; i %26lt; ndigits ; i++ )
. . . . outbuf [ i ] = int2hexchr(digits [ ndigits - i - 1 ]);
.
. . outbuf [ ndigits ] = '\0'; // null terminate
.
. . return outbuf;
}
again, you can write the int2hexchr function, and the
decimal version will be similar.
Reply:Is this your homework? You haven't posted your approach to solve the problem. If you do that I might be able to tell you where you are wrong. Anyway you take see for the algorithm at http://www.permadi.com/tutorial/numDecTo...
--
Ck
http://www.gfour.net
Suppose the input is :"4FDA12"
And the output should be:"5233170"
Suppose the input is :"F"
And the output is:"15"
2. To convert decimal to hexadecimal
Suppuse the input is "5233170"
And the output is "4FDA12"
Suppose the input is "15"
And the output is "F"
Please let me know how it work and how is the algorithm. I try to make it for 3 days but i confuse. I have a problem with how we save tomporaty the number and the counter to count how many digit is the output.
I still learn C language and i dont understand C++
Could someone please explain me and help me to build the 2 programs. I need the source code to improve my Algorithm skill.
:)
Thanks for ur help.
Good luck. Have a nice weekend..
Anyone can help me to make a "C language" program?
Just use strtoul to convert from string to integer, and sprintf
to convert from an interger back to a string.
Example 1:
val = strtoul(hexstr, NULL, 16); /* hex string to interger */
Example 2:
val = strtoul(decstr, NULL, 10); /* dec string to integer */
Example 3:
sprintf(hexstr, "%X", val); /* integer to hex string */
Example 4:
sprintf(decstr, "%d", val); /* integer to dec string */
If you're doing this for a class, then the instructor might have told
you that you are not allowed to use functions like strtoul and sprintf to do the conversion. In that case, you can do something like this...
// the dots at the beginning of each line are there because
// yahoo removes leading spaces
unsigned int hexstr2uint(char *hexstr)
{
. . unsigned int val = 0;
. . int temp;
. .
. . if (hexstr != NULL)
. . . . for( ; *hexstr ; hexstr++)
. . . . {
. . . . . . temp = hexchr2int( *hexstr );
. . . . . . if (temp == -1) /* stop if we reach an invalid char */
. . . . . . . . break;
.
. . . . . . val *= 16;
. . . . . . val += (unsigned int) temp;
. . . . }
.
. . return val;
}
You should be able to write the hexchr2int function, and
the decstr2uint function will be similar to the one I've shown
above.
To convert an integer to a string w/o using standard C functions...
char *uint2hexstr(unsigned int val, char *outbuf)
{
. . int digits[32], ndigits = 0, i = 0 ;
.
. . do
. . {
. . . . digits [ ndigits++ ] = val % 16;
. . . . val /= 16;
. . }
. . while(val %26gt; 0);
.
. . for ( i = 0; i %26lt; ndigits ; i++ )
. . . . outbuf [ i ] = int2hexchr(digits [ ndigits - i - 1 ]);
.
. . outbuf [ ndigits ] = '\0'; // null terminate
.
. . return outbuf;
}
again, you can write the int2hexchr function, and the
decimal version will be similar.
Reply:Is this your homework? You haven't posted your approach to solve the problem. If you do that I might be able to tell you where you are wrong. Anyway you take see for the algorithm at http://www.permadi.com/tutorial/numDecTo...
--
Ck
http://www.gfour.net
How to restart the system writing program using c/c++ language?
i want to know coding part (i mean program) how to restart my computer writing my own program using either c/c++ language
How to restart the system writing program using c/c++ language?
This trick is done, using the Windows API. Visit this link for some details:
http://www.codersource.net/mfc_shutdown_...
I hope this helps
Reply:no idea dont get a virus
Reply:frankly, I dont know if there is a uniform way of doing this.
but I can suggest a quick and dirty hack to do this
use something like
system("shutdown -r") on windows/linux etc.
These will invoke the native OS calls to do what you want. Its also really ugly. I am hoping someone else gives you a better way to solve this problem!
Reply:Using interrupts.. Refer Interrupt programmng in C - byu yeshwant kanethkar
Reply:There are two methods
1. Call the "shutdown.exe" (with params "/r" if you are on windows)
2. Send the system the appropriate termination signal
How to restart the system writing program using c/c++ language?
This trick is done, using the Windows API. Visit this link for some details:
http://www.codersource.net/mfc_shutdown_...
I hope this helps
Reply:no idea dont get a virus
Reply:frankly, I dont know if there is a uniform way of doing this.
but I can suggest a quick and dirty hack to do this
use something like
system("shutdown -r") on windows/linux etc.
These will invoke the native OS calls to do what you want. Its also really ugly. I am hoping someone else gives you a better way to solve this problem!
Reply:Using interrupts.. Refer Interrupt programmng in C - byu yeshwant kanethkar
Reply:There are two methods
1. Call the "shutdown.exe" (with params "/r" if you are on windows)
2. Send the system the appropriate termination signal
How to print the result in c language?
My actual question is how to print the result or some other thing using c language.
for example:
printf("\nName:X\nFrom:XX...........")...
output will be:
Name:x
From:XX..........
This output i should print in a paper.Pls help meeeee............
How to print the result in c language?
If you want to print variables and string using printf.. you will need to do:
printf("\nName:%s\nFrom:%s\n", str1, str2);
Output: (str1 = John, str2 = Yo)
Name: John
From: Yo
potential breakup song
for example:
printf("\nName:X\nFrom:XX...........")...
output will be:
Name:x
From:XX..........
This output i should print in a paper.Pls help meeeee............
How to print the result in c language?
If you want to print variables and string using printf.. you will need to do:
printf("\nName:%s\nFrom:%s\n", str1, str2);
Output: (str1 = John, str2 = Yo)
Name: John
From: Yo
potential breakup song
What is an identifier in the C language?give brief theme with examples and what is relation with variables?
Basics of C LANGUAGE
What is an identifier in the C language?give brief theme with examples and what is relation with variables?
An identifier is a human-readable name for a symbol. Symbol is short for symbolic representation of a memory location and/or its contents. Since both code and data reside in memory, a symbol can represent either a function or [what's commonly called] a variable.
Some say that, in the purest sense, a function is a variable -- to a degree that's true, but it's not common usage. Usually when someone says "variable" they're talking about a data declaration... usually but not always. (Warning: I'm about to crank-up the "confusing stuff knob" to 11.)
It is possible to declare a variable of type pointer to function, as opposed to declaring an actual function, e.g.,
// actual function
int foo(int bar)
{
return bar;
}
// define type "pointer to function that returns int,
// and accepts one int parameter"
typedef int (*LPFN_FOO)(int);
// declare a variable of type pointer to function [...], and assign
// the address of an actual function to it.
LPFN_FOO pFoo = foo;
// pFoo and foo can now be used interchangably
int a = pFoo(5);
int b = foo(5);
if (a == b)
printf("it's true!");
The point of all this is that in common usage the terms "variable" and "function" refer to two inherently different concepts/constructs. But that not withstanding, we see that sometimes the line between them blurs (so badly it almost vanishes) -- which serves to bring home the fact that functions and variables are just symbols, that are referenced in source code by their identifiers.
Reply:identifiers are basically a name for either a variable or a function.
variables are declared like this:
int varName;
int is the type of the variable (what kind of data it can hold) and varName is the name of the variable.
The significance is that you use the identifier to represent the variable, so if you wanted to assign the above variable a value you would do it like this:
varName = 10;
identifiers can all so be the names of functions and are declared like this:
int funcName(int varName)
{
//code...
}
where int is the return type, or what kind of data that function will return when called. funcName is the identifier by which the function is called, and int varName is a paramater.
the site in my sources is a great C tutorial.
What is an identifier in the C language?give brief theme with examples and what is relation with variables?
An identifier is a human-readable name for a symbol. Symbol is short for symbolic representation of a memory location and/or its contents. Since both code and data reside in memory, a symbol can represent either a function or [what's commonly called] a variable.
Some say that, in the purest sense, a function is a variable -- to a degree that's true, but it's not common usage. Usually when someone says "variable" they're talking about a data declaration... usually but not always. (Warning: I'm about to crank-up the "confusing stuff knob" to 11.)
It is possible to declare a variable of type pointer to function, as opposed to declaring an actual function, e.g.,
// actual function
int foo(int bar)
{
return bar;
}
// define type "pointer to function that returns int,
// and accepts one int parameter"
typedef int (*LPFN_FOO)(int);
// declare a variable of type pointer to function [...], and assign
// the address of an actual function to it.
LPFN_FOO pFoo = foo;
// pFoo and foo can now be used interchangably
int a = pFoo(5);
int b = foo(5);
if (a == b)
printf("it's true!");
The point of all this is that in common usage the terms "variable" and "function" refer to two inherently different concepts/constructs. But that not withstanding, we see that sometimes the line between them blurs (so badly it almost vanishes) -- which serves to bring home the fact that functions and variables are just symbols, that are referenced in source code by their identifiers.
Reply:identifiers are basically a name for either a variable or a function.
variables are declared like this:
int varName;
int is the type of the variable (what kind of data it can hold) and varName is the name of the variable.
The significance is that you use the identifier to represent the variable, so if you wanted to assign the above variable a value you would do it like this:
varName = 10;
identifiers can all so be the names of functions and are declared like this:
int funcName(int varName)
{
//code...
}
where int is the return type, or what kind of data that function will return when called. funcName is the identifier by which the function is called, and int varName is a paramater.
the site in my sources is a great C tutorial.
What can be created after learning c++ language, also how can i create my softwares?
HOW CAN I CREATE SOFTWARES?
WILL I BE ABLE TO CREATE SOFTWARES AFTER LEARNING C++ LANGUAGE?
What can be created after learning c++ language, also how can i create my softwares?
just learning the basic C++ language will not give you a handle on creating software apps. usually creating applications requires you to have a good handle on programming language. it will also mostly require that you know some form of database (either SQL, Access and Oracle). You will also most probably be working in a team (very few software apps are made by locking a programmer in a room and letting him/her churn out code).
WILL I BE ABLE TO CREATE SOFTWARES AFTER LEARNING C++ LANGUAGE?
What can be created after learning c++ language, also how can i create my softwares?
just learning the basic C++ language will not give you a handle on creating software apps. usually creating applications requires you to have a good handle on programming language. it will also mostly require that you know some form of database (either SQL, Access and Oracle). You will also most probably be working in a team (very few software apps are made by locking a programmer in a room and letting him/her churn out code).
How to enter a paragraph in C language?
code for entering a paragraph in C language
How to enter a paragraph in C language?
If you are asking about taking an entire paragraph as input text, then you need to use libraries for the same. Depending on which C you are using:
Turbo C: conio.h
Unix versions: curses.h
Reply:I don't know of such thing in C. Perhaps you're thinking of paragraph in terms of HTML coding? In HTML, %26lt;p%26gt; and %26lt;/p%26gt; are used to enclose a paragraph.
In C, you can manipulate and use the newline special character to do so; that is \n (backslash and the letter n).
Many newline special characters make up many newlines.
Reply:Use \n and \t.
Eg
printf("\tHello, there!\nHow you doin?\nSee ya later");
OUTPUT
Hello, there!
How you doin?
See ya later
\t - TAG SPACE
\n - NEW LINE
Senthil
How to enter a paragraph in C language?
If you are asking about taking an entire paragraph as input text, then you need to use libraries for the same. Depending on which C you are using:
Turbo C: conio.h
Unix versions: curses.h
Reply:I don't know of such thing in C. Perhaps you're thinking of paragraph in terms of HTML coding? In HTML, %26lt;p%26gt; and %26lt;/p%26gt; are used to enclose a paragraph.
In C, you can manipulate and use the newline special character to do so; that is \n (backslash and the letter n).
Many newline special characters make up many newlines.
Reply:Use \n and \t.
Eg
printf("\tHello, there!\nHow you doin?\nSee ya later");
OUTPUT
Hello, there!
How you doin?
See ya later
\t - TAG SPACE
\n - NEW LINE
Senthil
Example program of magic square in c language?
show the whole magic program in c language.
Example program of magic square in c language?
Homework? :-)
See the link to the source below.
Reply:#include "stdafx.h"
#include %26lt;vector%26gt;
using namespace std;
void OddMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n);
void DoublyEvenMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n);
void SinglyEvenMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n);
void MagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n);
void PrintMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n);
int main(int argc, char* argv[])
{
int n;
printf("Enter order of square: ");
scanf("%d", %26amp;n);
vector%26lt;vector%26lt;int%26gt; %26gt; matrix(n, vector%26lt;int%26gt; (n, 0));
if (n%26lt;3)
{
printf("\nError: n must be greater than 2\n\n");
return -1;
}
MagicSquare(matrix, n);
//Print results
PrintMagicSquare(matrix, n);
return 0;
}
void MagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix,int n)
{
if (n%2==1) //n is Odd
OddMagicSquare(matrix, n);
else //n is even
if (n%4==0) //doubly even order
DoublyEvenMagicSquare(matrix, n);
else //singly even order
SinglyEvenMagicSquare(matrix, n);
}
void OddMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n)
{
int nsqr = n * n;
int i=0, j=n/2; // start position
for (int k=1; k%26lt;=nsqr; ++k)
{
matrix[i][j] = k;
i--;
j++;
if (k%n == 0)
{
i += 2;
--j;
}
else
{
if (j==n)
j -= n;
else if (i%26lt;0)
i += n;
}
}
}
void DoublyEvenMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n)
{
vector%26lt;vector%26lt;int%26gt; %26gt; I(n, vector%26lt;int%26gt; (n, 0));
vector%26lt;vector%26lt;int%26gt; %26gt; J(n, vector%26lt;int%26gt; (n, 0));
int i, j;
//prepare I, J
int index=1;
for (i=0; i%26lt;n; i++)
for (j=0; j%26lt;n; j++)
{
I[i][j]=((i+1)%4)/2;
J[j][i]=((i+1)%4)/2;
matrix[i][j]=index;
index++;
}
for (i=0; i%26lt;n; i++)
for (j=0; j%26lt;n; j++)
{
if (I[i][j]==J[i][j])
matrix[i][j]=n*n+1-matrix[i][j];
}
}
void SinglyEvenMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n)
{
int p=n/2;
vector%26lt;vector%26lt;int%26gt; %26gt; M(p, vector%26lt;int%26gt; (p, 0));
MagicSquare(M, p);
int i, j, k;
for (i=0; i%26lt;p; i++)
for (j=0; j%26lt;p; j++)
{
matrix[i][j]=M[i][j];
matrix[i+p][j]=M[i][j]+3*p*p;
matrix[i][j+p]=M[i][j]+2*p*p;
matrix[i+p][j+p]=M[i][j]+p*p;
}
if (n==2)
return;
vector%26lt;int%26gt; I(p, 0);
vector%26lt;int%26gt; J;
for (i=0; i%26lt;p; i++)
I[i]=i+1;
k=(n-2)/4;
for (i=1; i%26lt;=k; i++)
J.push_back(i);
for (i=n-k+2; i%26lt;=n; i++)
J.push_back(i);
int temp;
for (i=1; i%26lt;=p; i++)
for (j=1; j%26lt;=J.size(); j++)
{
temp=matrix[i-1][J[j-1]-1];
matrix[i-1][J[j-1]-1]=matrix[i+p-1][J[j-...
matrix[i+p-1][J[j-1]-1]=temp;
}
//j=1, i
//i=k+1, k+1+p
i=k;
j=0;
temp=matrix[i][j]; matrix[i][j]=matrix[i+p][j]; matrix[i+p][j]=temp;
j=i;
temp=matrix[i+p][j]; matrix[i+p][j]=matrix[i][j]; matrix[i][j]=temp;
}
void PrintMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n)
{
for (int i=0; i%26lt;n; i++)
{
for (int j=0; j%26lt;n; j++)
printf(" %3d", matrix[i][j]);
printf("\n");
}
printf("\n\n");
}
love song
Example program of magic square in c language?
Homework? :-)
See the link to the source below.
Reply:#include "stdafx.h"
#include %26lt;vector%26gt;
using namespace std;
void OddMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n);
void DoublyEvenMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n);
void SinglyEvenMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n);
void MagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n);
void PrintMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n);
int main(int argc, char* argv[])
{
int n;
printf("Enter order of square: ");
scanf("%d", %26amp;n);
vector%26lt;vector%26lt;int%26gt; %26gt; matrix(n, vector%26lt;int%26gt; (n, 0));
if (n%26lt;3)
{
printf("\nError: n must be greater than 2\n\n");
return -1;
}
MagicSquare(matrix, n);
//Print results
PrintMagicSquare(matrix, n);
return 0;
}
void MagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix,int n)
{
if (n%2==1) //n is Odd
OddMagicSquare(matrix, n);
else //n is even
if (n%4==0) //doubly even order
DoublyEvenMagicSquare(matrix, n);
else //singly even order
SinglyEvenMagicSquare(matrix, n);
}
void OddMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n)
{
int nsqr = n * n;
int i=0, j=n/2; // start position
for (int k=1; k%26lt;=nsqr; ++k)
{
matrix[i][j] = k;
i--;
j++;
if (k%n == 0)
{
i += 2;
--j;
}
else
{
if (j==n)
j -= n;
else if (i%26lt;0)
i += n;
}
}
}
void DoublyEvenMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n)
{
vector%26lt;vector%26lt;int%26gt; %26gt; I(n, vector%26lt;int%26gt; (n, 0));
vector%26lt;vector%26lt;int%26gt; %26gt; J(n, vector%26lt;int%26gt; (n, 0));
int i, j;
//prepare I, J
int index=1;
for (i=0; i%26lt;n; i++)
for (j=0; j%26lt;n; j++)
{
I[i][j]=((i+1)%4)/2;
J[j][i]=((i+1)%4)/2;
matrix[i][j]=index;
index++;
}
for (i=0; i%26lt;n; i++)
for (j=0; j%26lt;n; j++)
{
if (I[i][j]==J[i][j])
matrix[i][j]=n*n+1-matrix[i][j];
}
}
void SinglyEvenMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n)
{
int p=n/2;
vector%26lt;vector%26lt;int%26gt; %26gt; M(p, vector%26lt;int%26gt; (p, 0));
MagicSquare(M, p);
int i, j, k;
for (i=0; i%26lt;p; i++)
for (j=0; j%26lt;p; j++)
{
matrix[i][j]=M[i][j];
matrix[i+p][j]=M[i][j]+3*p*p;
matrix[i][j+p]=M[i][j]+2*p*p;
matrix[i+p][j+p]=M[i][j]+p*p;
}
if (n==2)
return;
vector%26lt;int%26gt; I(p, 0);
vector%26lt;int%26gt; J;
for (i=0; i%26lt;p; i++)
I[i]=i+1;
k=(n-2)/4;
for (i=1; i%26lt;=k; i++)
J.push_back(i);
for (i=n-k+2; i%26lt;=n; i++)
J.push_back(i);
int temp;
for (i=1; i%26lt;=p; i++)
for (j=1; j%26lt;=J.size(); j++)
{
temp=matrix[i-1][J[j-1]-1];
matrix[i-1][J[j-1]-1]=matrix[i+p-1][J[j-...
matrix[i+p-1][J[j-1]-1]=temp;
}
//j=1, i
//i=k+1, k+1+p
i=k;
j=0;
temp=matrix[i][j]; matrix[i][j]=matrix[i+p][j]; matrix[i+p][j]=temp;
j=i;
temp=matrix[i+p][j]; matrix[i+p][j]=matrix[i][j]; matrix[i][j]=temp;
}
void PrintMagicSquare(vector%26lt;vector%26lt;int%26gt; %26gt; %26amp;matrix, int n)
{
for (int i=0; i%26lt;n; i++)
{
for (int j=0; j%26lt;n; j++)
printf(" %3d", matrix[i][j]);
printf("\n");
}
printf("\n\n");
}
love song
What the basic example for C programming language?
how to create C language for example record voice and playback....
What the basic example for C programming language?
Are you looking to learn how to write a c program or you know how to program in c and would like to write a program to record voice?
Reply:If you have never programmed before, how do you expect to create such a complicated program as what you are describing? Report It
Reply:Depends on system since these media libs are system specific
What the basic example for C programming language?
Are you looking to learn how to write a c program or you know how to program in c and would like to write a program to record voice?
Reply:If you have never programmed before, how do you expect to create such a complicated program as what you are describing? Report It
Reply:Depends on system since these media libs are system specific
Write a well documented program in c-language to reverse the given no. without using array.?
write a well documented program in c-language to reverse the given no. without using array.e.g. if input is 456 the output should be 654.
Write a well documented program in c-language to reverse the given no. without using array.?
Do your own homework.
Hint: use recursion.
Write a well documented program in c-language to reverse the given no. without using array.?
Do your own homework.
Hint: use recursion.
How to print output in the "C" language programming?
I want to print the output of programme in "C" language
is it possible
How to print output in the "C" language programming?
Look up the printf() function. That is a good place to start.
Oh! wait if you want to take it directly to the printer then if you are on unix then you can just pipe your program to the printer device.
$ myprogram | lpd
On Windows, you could save your output to a file and then print that file with notepad.
c:\dev\myprogram %26gt;output.txt
c:\dev\notepad output.txt
Reply:Here's some examples
printf ("Hello");
cout%26lt;%26lt;"Hello";
int num = 3;
printf("Num : %d",num)
cout%26lt;%26lt;"Num : "%26lt;%26lt;num;
Reply:Print it how? Not to be mean but one of the fascinating things about these answers is how everyone interprets your question differently. I don't think you're irresponsible but it would be nice if you added in additional information whether you want to print it to the screen or to the printer.
I'm on Linux. I have been for a few years and haven't concerned myself with printing to recent iterations of Windows. Both Linux and MS-Dos (the ancestor of Windows) took from Unix the policy of treating everything as a file, even device drivers. Win32 versions like the last ones I did any programming on, continued this. PRN and LPT1 I believe are the names of the printing device in Windows. stdout is the name of the screen in C, period.
Cout is just wrong, if you're asking about C rather than C++. Cout is stdout in the iostream.h library, which is C++, not C. You send variables to it using the %26lt;%26lt; operator, which is also in iostream. What I have to say below applies to a C++ program, once it's compiled.
The C output is usually taken care of by one of 2 functions: printf("format string", variable1, variable2...); or fprintf(Outputdevice, "format string", variable1, variable2...);. You can see how similar they are. Printf is short for PRINT Format. Fprintf is short for File PRINT Format. Printf is the functional equivalent of fprintf(stdout, "format string", ...); Of course you should read the documentation which will tell you among other things, that if you don't have any variables in your format string, you don't need a comma and variable list after, and you only need as many variables in your list as you have indicated in your format string. Most C compilers don't have names for your printer, so if your documentation doesn't indicate one you probably can't make fprintf(PRN...) work. You have two choices. You can use printf or you can open up a file and fprintf your output to the file. Then of course you can send the output file to your printer. In Unix and in older MS/Dos/Windows you can send it a couple of ways. In Unix/Linux just type lpr filename or executable_file %26gt; lpr. In Windows, type executable_file %26gt; prn or print filename. In Windows you will be asked if you want to overwrite prn. Answer yes. Windows treats your prn as a file, but it isn't a file, it's a device, so instead of messing up your driver you will be sending all the characters to the device to print out.
I know this sounds heavy but I'm tired. I hope it helps.
Reply:Use the printf function, which is included in the stdio.h header file.
To include said header file, simply put #include %26lt;stdio.h%26gt; at the very top of your code (this is a preprocessor instruction).
Using printf is simple - it takes a single string argument/parameter, and you can use %d, %f etc to substitute with various variables which can also be passed to the function as extra arguments.
Reply:For Free C++ Lessons For Beginner
Enter Programming_Share Group
Omar Abdallah
is it possible
How to print output in the "C" language programming?
Look up the printf() function. That is a good place to start.
Oh! wait if you want to take it directly to the printer then if you are on unix then you can just pipe your program to the printer device.
$ myprogram | lpd
On Windows, you could save your output to a file and then print that file with notepad.
c:\dev\myprogram %26gt;output.txt
c:\dev\notepad output.txt
Reply:Here's some examples
printf ("Hello");
cout%26lt;%26lt;"Hello";
int num = 3;
printf("Num : %d",num)
cout%26lt;%26lt;"Num : "%26lt;%26lt;num;
Reply:Print it how? Not to be mean but one of the fascinating things about these answers is how everyone interprets your question differently. I don't think you're irresponsible but it would be nice if you added in additional information whether you want to print it to the screen or to the printer.
I'm on Linux. I have been for a few years and haven't concerned myself with printing to recent iterations of Windows. Both Linux and MS-Dos (the ancestor of Windows) took from Unix the policy of treating everything as a file, even device drivers. Win32 versions like the last ones I did any programming on, continued this. PRN and LPT1 I believe are the names of the printing device in Windows. stdout is the name of the screen in C, period.
Cout is just wrong, if you're asking about C rather than C++. Cout is stdout in the iostream.h library, which is C++, not C. You send variables to it using the %26lt;%26lt; operator, which is also in iostream. What I have to say below applies to a C++ program, once it's compiled.
The C output is usually taken care of by one of 2 functions: printf("format string", variable1, variable2...); or fprintf(Outputdevice, "format string", variable1, variable2...);. You can see how similar they are. Printf is short for PRINT Format. Fprintf is short for File PRINT Format. Printf is the functional equivalent of fprintf(stdout, "format string", ...); Of course you should read the documentation which will tell you among other things, that if you don't have any variables in your format string, you don't need a comma and variable list after, and you only need as many variables in your list as you have indicated in your format string. Most C compilers don't have names for your printer, so if your documentation doesn't indicate one you probably can't make fprintf(PRN...) work. You have two choices. You can use printf or you can open up a file and fprintf your output to the file. Then of course you can send the output file to your printer. In Unix and in older MS/Dos/Windows you can send it a couple of ways. In Unix/Linux just type lpr filename or executable_file %26gt; lpr. In Windows, type executable_file %26gt; prn or print filename. In Windows you will be asked if you want to overwrite prn. Answer yes. Windows treats your prn as a file, but it isn't a file, it's a device, so instead of messing up your driver you will be sending all the characters to the device to print out.
I know this sounds heavy but I'm tired. I hope it helps.
Reply:Use the printf function, which is included in the stdio.h header file.
To include said header file, simply put #include %26lt;stdio.h%26gt; at the very top of your code (this is a preprocessor instruction).
Using printf is simple - it takes a single string argument/parameter, and you can use %d, %f etc to substitute with various variables which can also be passed to the function as extra arguments.
Reply:For Free C++ Lessons For Beginner
Enter Programming_Share Group
Omar Abdallah
Help me regarding Computer Ports using C language?
Is there any way of sending a stream of bits from Serial or parallel port of my computer using C language?
Help me regarding Computer Ports using C language?
Try using functions like inport(for reading the port) and outport(for sending data to the port) in dos.h. These functions require a port no. where U want to send the data and the data (binary data converted into decimal, like U wanna active first 4 data pins of Ur parallel port and deactivate the remaining 4 then U can use the data 11110000, which when converted to decimal gives 240, so enter this value along with the port no. while calling the function).
Reply:Yes, in most compilers there are functions called inportB %26amp; outportB that are designed for that. Look in your compiler's docs. Also, you can open a file to either divice using a DOS name in a DOS environment. If, however, you want to create a Win32s API application, then you need to find the API calls to do this. Start at the URL below.
Reply:At codeproject you will find tons of ready projects with full sources.
Reply:Certainly. You write to the port just like writing to a file. That is, you create a handle to the "file" and write to it, then close it. I recommend reading the documentation.
Reply:yes i tcan be done........... but i donno how to do that...........
garden flowers
Help me regarding Computer Ports using C language?
Try using functions like inport(for reading the port) and outport(for sending data to the port) in dos.h. These functions require a port no. where U want to send the data and the data (binary data converted into decimal, like U wanna active first 4 data pins of Ur parallel port and deactivate the remaining 4 then U can use the data 11110000, which when converted to decimal gives 240, so enter this value along with the port no. while calling the function).
Reply:Yes, in most compilers there are functions called inportB %26amp; outportB that are designed for that. Look in your compiler's docs. Also, you can open a file to either divice using a DOS name in a DOS environment. If, however, you want to create a Win32s API application, then you need to find the API calls to do this. Start at the URL below.
Reply:At codeproject you will find tons of ready projects with full sources.
Reply:Certainly. You write to the port just like writing to a file. That is, you create a handle to the "file" and write to it, then close it. I recommend reading the documentation.
Reply:yes i tcan be done........... but i donno how to do that...........
garden flowers
From where can i get software for "c" language?????
Hi i am doing "c" language course.I want the software in which i can practise all the commands and instruction .I mean i have a software called TURBO C++ but it didn't work.please tell me from where i can download it.best answer will be given 15 points.
From where can i get software for "c" language?????
Visual Studio
http://www.microsoft.com/express/vc/
Reply:A great C/C++ IDE to learn with is Dev-C++:
http://www.bloodshed.net/devcpp.html
If you are more of a command-line guy (or just want to get a *nix type feel), try MinGW or Cygwin:
http://www.mingw.org/
http://www.cygwin.com/
If you want the ultimate command-line/native learning experience, install a Linux distro.
Reply:Microsoft releases a free version of Visual C++ .NET you can get info here
http://www.microsoft.com/express/vc/
You can also get a compiler here
http://www.mingw.org/
Hope this helps
Reply:You can download the Tiny C compiler at http://fabrice.bellard.free.fr/tcc/
Other C compilers are listed on Wikipedia:
http://en.wikipedia.org/wiki/List_of_com...
From where can i get software for "c" language?????
Visual Studio
http://www.microsoft.com/express/vc/
Reply:A great C/C++ IDE to learn with is Dev-C++:
http://www.bloodshed.net/devcpp.html
If you are more of a command-line guy (or just want to get a *nix type feel), try MinGW or Cygwin:
http://www.mingw.org/
http://www.cygwin.com/
If you want the ultimate command-line/native learning experience, install a Linux distro.
Reply:Microsoft releases a free version of Visual C++ .NET you can get info here
http://www.microsoft.com/express/vc/
You can also get a compiler here
http://www.mingw.org/
Hope this helps
Reply:You can download the Tiny C compiler at http://fabrice.bellard.free.fr/tcc/
Other C compilers are listed on Wikipedia:
http://en.wikipedia.org/wiki/List_of_com...
A good book & website for C language ??
hey guyz, im starting practicing C LANGUAGE, so i need a name of a good C BOOK %26amp; WEBSITE, so tht i can refer to it .. if get messed up..
help will be appreciated
A good book %26amp; website for C language ??
K%26amp;R's The C Programming Language.
http://cprogramming.com/
http://c-faq.com/
and finally... GOOGLE.
Reply:As the man sez above, google 'tutorial c language'. Also, K%26amp;R can't be beat, although there are some 'dummies' or 'nutshell' or '...in 24 hours' books that take a different approach.
calling cards
help will be appreciated
A good book %26amp; website for C language ??
K%26amp;R's The C Programming Language.
http://cprogramming.com/
http://c-faq.com/
and finally... GOOGLE.
Reply:As the man sez above, google 'tutorial c language'. Also, K%26amp;R can't be beat, although there are some 'dummies' or 'nutshell' or '...in 24 hours' books that take a different approach.
calling cards
Is it possible to learn C language by self study with specified book and a PC?
pls suggest me a c language book for learning from basics!
Is it possible to learn C language by self study with specified book and a PC?
yes.
refer +2 c books for basics.
Reply:Yes, you need a lot of books as reference, I'm sure you can find 1 in the library before you invest on 1 to keep.
No, you need to try it out so you have to get an Intergrated Development Environment(IDE) and the complier here is free software.
http://www.download.com/Bloodshed-Dev-C-...
Reply:yes and yes
bookpool.com
cheap books for study,
else go to devshed.com for answers.
Reply:C++ for Dummies. No offense intended. You can find it at Amazon.com.
Reply:C by Yashwant Kanetkar. Amazingly easy and lucid.
Reply:If you know the computer basics, you can start immediately.
It is always better to have mentor to phase up your learning.
Start with any good book with fewer pages, it gives you confidence when you finish your first book.
Reply:Yes you can! There are a ton of books and web site tutorials, search Google. And there are free compilers. Linux has a couple of good ones. Novel Linux Desktop ( SUSE )has an awesome IDE environment that you can download for free that will compile/assemble a large number of languages including C and it is GUI based.
Reply:Yes it is possible to learn C... The best book available is
"Programming in C by Dennis Ritchie". There is also a book by Lafore but i am not sure abt the Title
Is it possible to learn C language by self study with specified book and a PC?
yes.
refer +2 c books for basics.
Reply:Yes, you need a lot of books as reference, I'm sure you can find 1 in the library before you invest on 1 to keep.
No, you need to try it out so you have to get an Intergrated Development Environment(IDE) and the complier here is free software.
http://www.download.com/Bloodshed-Dev-C-...
Reply:yes and yes
bookpool.com
cheap books for study,
else go to devshed.com for answers.
Reply:C++ for Dummies. No offense intended. You can find it at Amazon.com.
Reply:C by Yashwant Kanetkar. Amazingly easy and lucid.
Reply:If you know the computer basics, you can start immediately.
It is always better to have mentor to phase up your learning.
Start with any good book with fewer pages, it gives you confidence when you finish your first book.
Reply:Yes you can! There are a ton of books and web site tutorials, search Google. And there are free compilers. Linux has a couple of good ones. Novel Linux Desktop ( SUSE )has an awesome IDE environment that you can download for free that will compile/assemble a large number of languages including C and it is GUI based.
Reply:Yes it is possible to learn C... The best book available is
"Programming in C by Dennis Ritchie". There is also a book by Lafore but i am not sure abt the Title
I want a program in c language that execute ADI method for 2 dimensional parabolic pde?
i need a written program in c language to execute ADI method fo a 2 dimensional parabolic pde.
I want a program in c language that execute ADI method for 2 dimensional parabolic pde?
You may have to write it yourself. Have you looked at MatLab or any of those?
Doug
I want a program in c language that execute ADI method for 2 dimensional parabolic pde?
You may have to write it yourself. Have you looked at MatLab or any of those?
Doug
Sunday, July 12, 2009
I always heard about C++ , VIsual Basic and other C language. Can someone explain about Q basic?
is it q basic some kind like C++ language? How to use and is there any special system or download or etc.
I always heard about C++ , VIsual Basic and other C language. Can someone explain about Q basic?
Here's link regarding QBASIC. You can download it from the link below.
Here is a link for download of Visual Basic for DOS - it's free!
Reply:QBASIC is old
Reply:QBasic was a programming environment shipped with MS-DOS.
and a lot of good features, but its main problem was that you couldn't make executable programs with it, you had to enter the QBasic environment in order to run it. And as it was an MS-DOS program you could make only DOS programs and couldn't take advantage of the Windows libraries.
QBasic version 4.5 also made exe files.
Visual Basic based its syntax on QBasic.
Reply:QBASIC stands for quick Basic, we can say it is a version of very old BASIC language. the other version is GW BASIC, but today it is of no use, it was used earlier to teach programming to the beginners.
Reply:QBasic, the name derived from QuickBasic. The expansion of BASIC is Beginner's All-purpose Symbolic Instruction Code.
This is one of the earliest high level programming language using which we can create software programs.
It was originally designed in 1963, by John George Kemeny and Thomas Eugene Kurtz at Dartmouth College.
I don't know what you are trying to achieve using a language that had been frequently in PC DOS era.
C++ is a powerful language based on C programming language that supports structured programming as well as object-oriented programming.
I always heard about C++ , VIsual Basic and other C language. Can someone explain about Q basic?
Here's link regarding QBASIC. You can download it from the link below.
Here is a link for download of Visual Basic for DOS - it's free!
Reply:QBASIC is old
Reply:QBasic was a programming environment shipped with MS-DOS.
and a lot of good features, but its main problem was that you couldn't make executable programs with it, you had to enter the QBasic environment in order to run it. And as it was an MS-DOS program you could make only DOS programs and couldn't take advantage of the Windows libraries.
QBasic version 4.5 also made exe files.
Visual Basic based its syntax on QBasic.
Reply:QBASIC stands for quick Basic, we can say it is a version of very old BASIC language. the other version is GW BASIC, but today it is of no use, it was used earlier to teach programming to the beginners.
Reply:QBasic, the name derived from QuickBasic. The expansion of BASIC is Beginner's All-purpose Symbolic Instruction Code.
This is one of the earliest high level programming language using which we can create software programs.
It was originally designed in 1963, by John George Kemeny and Thomas Eugene Kurtz at Dartmouth College.
I don't know what you are trying to achieve using a language that had been frequently in PC DOS era.
C++ is a powerful language based on C programming language that supports structured programming as well as object-oriented programming.
Sieve of Erathosthenes Algorithm in C++ Language (Finding all prime numbers)?
I need Eratosthenes Algorithm in C++ language (to find out prime numbers). I can write it in a few other ways, but I need to do it using a a vector container for the integers, and an array of bool initially set to true to keep track of the crossed off numbers. also by Changing the entry to false for integers that are crossed off the list.
I will appreciate any help. Partial code, if not all. Thank you very much.
Sieve of Erathosthenes Algorithm in C++ Language (Finding all prime numbers)?
I ran this a long time ago:
http://gd.tuwien.ac.at/perf/benchmark/ab...
pokemon cards
I will appreciate any help. Partial code, if not all. Thank you very much.
Sieve of Erathosthenes Algorithm in C++ Language (Finding all prime numbers)?
I ran this a long time ago:
http://gd.tuwien.ac.at/perf/benchmark/ab...
pokemon cards
How to create sudoku in "C" Language ?
Hi all
i want to know how do i build a program in "C" language that solve sudoku
thanks all
How to create sudoku in "C" Language ?
Yep, lots already out there.
You can go here:
http://www.osix.net/modules/article/?id=...
or here:
http://www.techfinesse.com/game/sudoku_s...
or just do a google search for: solve sudoku c
You will have lots to read and explore. Bon Voyage!
i want to know how do i build a program in "C" language that solve sudoku
thanks all
How to create sudoku in "C" Language ?
Yep, lots already out there.
You can go here:
http://www.osix.net/modules/article/?id=...
or here:
http://www.techfinesse.com/game/sudoku_s...
or just do a google search for: solve sudoku c
You will have lots to read and explore. Bon Voyage!
How to create sudoku in "C" Language ?
Hi all
i want to know how do i build a program in "C" language that solve sudoku
thanks all
How to create sudoku in "C" Language ?
Well what do you already have? I can think of a few ways. Tell me what you started with and I'll be glad to help!
i want to know how do i build a program in "C" language that solve sudoku
thanks all
How to create sudoku in "C" Language ?
Well what do you already have? I can think of a few ways. Tell me what you started with and I'll be glad to help!
Subscribe to:
Posts (Atom)