my-free-tutorials.blogspot.com
FREE TUTORIALS: Arrays
http://my-free-tutorials.blogspot.com/2009/02/arrays.html
Arrays of any type can be formed in C. The syntax is simple:. In C, arrays starts at position 0. The elements of the array occupy adjacent locations in memory. C treats the name of the array as if it were a pointer to the first element- this is important in understanding how to do arithmetic with arrays. Thus, if. Is an array,. Is the same thing as. Is the same thing as. Pointer use for an array. Consider the following code, which illustrates the use of pointers:. Initialize the array x. For (i = 0; i.
cpp4uu.blogspot.com
C++ PROGRAMS: C++ PROGRAMS (STAGE-V)
http://cpp4uu.blogspot.com/2009/12/c-programs-stage-v.html
TO INVOKE A FUNCTION TO FIND THE LEAST COMMON DIVISOR OF TWO INTEGERS. Int lcd(int a,int b). Int i,j=2,flag=1;. While( j =i)& (flag). If( a%j= 0)& (b%j= 0). Cout " nENTER 2 NUMBERS WHOSE LCD IS TO BE FOUND : ";. Cout " nTHE LCD OF GIVEN 2 NUMBERS IS : " z endl;. ENTER 2 NUMBERS WHOSE LCD IS TO BE FOUND : 185. THE LCD OF GIVEN 2 NUMBERS IS : 37. Http:/ sundcs.blogspot.com/. TO FIND THE LCM AND HCF OF GIVEN 3 NUMBERS. Void lcm(int, int, int);. Void hcf(int, int, int);. Lcm(a,b,c);. Hcf(a,b,c);. Cout " nRET...
cpp4uu.blogspot.com
C++ PROGRAMS: C++ PROGRAMS (STAGE-IV)
http://cpp4uu.blogspot.com/2009/12/c-programs-stage-iv.html
ADDITION OF TWO MATRICES. Int a[10][10],b[10][10],c[10][10],count1, count2,ra,ca,rb,cb;. Cout " nINPUT ROW FOR MATRIX A: ";. Cout " nINPUT COLUMN FOR MATRIX A: ";. Cout " nINPUT ROW FOR MATRIX B: ";. Cout " nINPUT COLUMN FOR MATRIX B: ";. If( ra= rb)& (ca= cb). Cout " nTHE TWO MATRICES CAN BE ADDED AS THEY ARE IDENTICAL.";. Cout " nTHE TWO MATRICES CANNOT BE ADDED SINCE THEY ARE INIDENTICAL.";. Cout " nTHANK YOU.";. Cout " n nINPUT ELEMENTS FOR MATRIX A : n";. For(count1=0;count1 ra;count1 ). Cout " n";.
my-free-tutorials.blogspot.com
FREE TUTORIALS: Pointer types and Arrays
http://my-free-tutorials.blogspot.com/2009/02/pointer-types-and-arrays.html
Pointer types and Arrays. Let us consider why we need to identify the type. Of variable that a pointer points to, as in:. One reason for doing this is so that later, once ptr "points to" something, if we write:. The compiler will know how many bytes to copy into that memory location pointed to by ptr. Was declared as pointing to an integer, 4 bytes would be copied. Now, let's say we point our integer pointer ptr. Instead of 1, so the pointer "points to" the next. Declared as a pointer to a short, it woul...
my-free-tutorials.blogspot.com
FREE TUTORIALS: Pointers
http://my-free-tutorials.blogspot.com/2009/02/pointers.html
The C language allows the programmer to ` peek and poke' directly into memory locations. This gives great flexibility and power to the language, but it also one of the great hurdles that the beginner must overcome in using the language. All variables in a program reside in memory; the statements. Request that the compiler reserve 4 bytes of memory (on a 32-bit computer) for the floating-point variable. Then put the ` value' 6.5 in it. Before its name. Therefore. Is the address of. Operator (this is called.
my-free-tutorials.blogspot.com
FREE TUTORIALS: Command-line arguments
http://my-free-tutorials.blogspot.com/2009/02/command-line-arguments.html
It is standard practice in UNIX for information to be passed from the command line directly into a program through the use of one or more command-line arguments, or. Switches are typically used to modify the behavior of a program, or to set the values of some internal parameters. You have already encountered several of these- for example, the. Command lists the files in your current directory, but when the switch. Produces a so-called ` long' listing instead. Similarly,. Array of character strings. Don't...
my-free-tutorials.blogspot.com
FREE TUTORIALS: Pointers and Structures
http://my-free-tutorials.blogspot.com/2009/02/pointers-and-structures.html
As you may know, we can declare the form of a block of data containing different data types by means of a structure declaration. For example, a personnel file might contain structures which look something like:. Eg 1275 per hour */. For review, recall that we can access structure members with the dot operator as in:. Program 5 - - - - - - - - -. Program 5.1 */. Eg 1275 per hour */. Struct tag my struct;. Declare the structure my struct */. Strcpy(my struct.lname,"Jensen");. End of program 5 - - - - - - -.
my-free-tutorials.blogspot.com
FREE TUTORIALS: Character Arrays
http://my-free-tutorials.blogspot.com/2009/02/character-arrays_13.html
I am a string". Is an array of characters. It is represented internally in C by the ASCII characters in the string, i.e., `. For the above string, and terminated by the special null character `. So programs can find the end of the string. String constants are often used in making the output of code intelligible using. Printf("Hello, world n");. Printf("The value of a is: %f n", a);. String constants can be associated with variables. C provides the. Char text 1[100], text 2[100], text 3[100];. While ( ( *...
cs-lab-programs.blogspot.com
MY COMPUTER LAB. PROGRAMS: OBJECT ORIENTED PROGRAMMING LAB. PROGRAMS
http://cs-lab-programs.blogspot.com/2010/01/object-oriented-programming-lab_7844.html
MY COMPUTER LAB. PROGRAMS. OBJECT ORIENTED PROGRAMMING LAB. PROGRAMS. Program to display numbers between 0 to 9 as well as 9 to 0 simultaneously one by one */. For(i=0,j=9;i =9,j =0;i ,j- ). Cout i " " j " n";. Http:/ sundcs.blogspot.com/. Program to display student information using structures */. Int rollno,age;. Struct student s;. Cout "enter the name of the student n";. Cout "enter the rollno of the student n";. Cout "enter the age of the student n";. Cout "Name is:" s.name;. Int rollno,age;. Cout "e...