ALGORITHM SAMPLE
i = 0
REPEAT
OUTPUT ("Enter a number: ")
INPUT (number[i])
i ++
UNTIL (number[i] 0) THEN
counter++
sum = sum + number[i]
END IF
END FOR
DISPLAY (counter)
DISPLAY (sum / counter)
END SAMPLE
deleting a node
What is the term 'fprintf' used in?
The term "fprintf" is a command used in the computer programming language C++. The command "fprintf" in C++ is used to print formatted data to a stream.
What is the meaning of ten high level programming language?
'ten' is a number; google for 'high level programming language'
Could you please clarify what "d" and "n" refer to? Without more context, it's difficult to provide an accurate answer regarding their closing times.
Can Mathematica be used for AI Programming?
The short answer is yes. Any full language is capable of this.
You might want to look at the book "Illustrating Evolutionary Computation with Mathematica", for some examples.
Are the variables argc and argv are local to main?
yes they are local to main
Program to accept n number from user and dispay its next 10 odd number using function?
#include
#include
void main()
{
int n;
void print(int n);
clrscr();
printf("Enter the number:");
scanf("%d",&n);
print(n);
getch();
}
void print(int n)
{
int i;
for(i=1;i<=10;i++)
{
if(n%2!=0)
n+=2;
else
n+=1;
printf("%2d.%2d\n",i,n);
}
}
Output:
Enter the number:5
1. 7
2. 9
3.11
4.13
5.15
6.17
7.19
8.21
9.23
10.25
Enter the number:4
1. 5
2. 7
3. 9
4.11
5.13
6.15
7.17
8.19
9.21
10.23
Definition of sentinel-controlled loop?
The minimum number of multiplications required to evaluate the expression?
It depends on the expression.
What is the relationship between an array and a pointer?
All variable names are an alias for the value stored at the memory address allocated to them. To get the memory address itself, you must use the address of operator (&). The value returned from this can then be stored in a pointer variable.
Arrays are different. The array name is an alias for the start address of the array, thus you do not need the address ofoperator to obtain the memory address (although you can if you want to). This means that when you pass an array name to a function, you pass the memory address of the array rather than passing the array itself (which would require the entire array to be copied, which is a highly inefficient way to pass an array). In essence, the array is passed by reference rather than by value.
Consider the following code. This shows how a primitive variable name differs from the name of an array of primitive variables. The final portion shows how a pointer can be used to achieve the same results you got by accessing the array elements directly from the array name itself. This is in fact how the compiler implements arrays, using pointers, but there's no need to do this in your code. Accessing array elements directly by their index is a programming convenience.
#include
using namespace std;
int main()
{
int i = 10;
cout << "&i = address of i:\t0x" << &i << endl;
cout << "i = value of i:\t" << i << endl;
cout << endl;
int Array[10] = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 };
cout << "&Array = address of Array:\t0x" << &Array << endl; // same as next line.
cout << "Array = address of Array:\t0x" << Array << endl; // same as previous line.
cout << "*Array = value of Array[0]:\t" << *Array << endl; // returns value of first element.
cout << endl;
int offset=0;
for( offset=0; offset<10; ++offset )
{
cout << "&Array[" << offset << "] = address of element " << offset << ":\t0x" << &Array[offset] << endl;
cout << "Array[" << offset << "] = value of element " << offset << ":\t" << Array[offset] << endl;
}
cout << endl;
int * pointer = Array; // point to the array address.
cout << "&pointer = address of pointer:\t\t0x" << &pointer << "\t(never changes)" << endl;
cout << endl;
for( offset=0; offset<10; ++offset )
{
cout << "pointer = address stored in 0x" << &pointer << ":\t0x" << pointer << "\t(same as &Array[" << offset << "]" << endl;
cout << "*pointer = value stored in 0x" << pointer << ":\t" << *pointer << "\t\t(same as Array[" << offset << "]" << endl;
++pointer;
}
cout << endl;
return( 0 );
}
How do you combine 3 parts into 1 iso?
Simply open Commmand Prompt. Navigate to the folder that contains all the parts, and enter this command: copy /b example1.iso + example2.iso + example3.iso + example4.iso finishedexample.iso . This works only with windows cmd of course.
What is convolution of a signal?
the convolution of a signal is to filter the components of the signal.
The convolution does not mean the masking.
Masking means it is going to remove all the masked components(both high and low frequency components).But convolution is going to remove any one (either low r high frequency) depending upon the filter response.
There is nothing wrong with 'puts' but you should avoid the using of 'gets', and even 'fgets' has a disadvantage: if the input contains a binary zero, you will lose data.
What is a ribbon parameter card?
The "ribbon parameter card" is a little chip that is delivered with every newly bought pack of ribbons. You need to insert this card in the fitting slot of the printer (at the backside I assume), and let the printer read the contents of the chip. Once finished, you can remove the card.
You need to follow this procedure for the printer to be able to work with the new ribbon. If you do not have the chip for that ribbon you can not use it.
Write a program t remove the occurrences of word in entered text in c?
#include
#include
#define n 100
void del_char(char str1[n],char str2[])
{
char str[n],*p1,*q,i,j;
p1=str1;
q=str;
*q=*p1;
i=0;
while(*p1!='\0')
{
{
if(*p1==str2[i])
{
p1++;
i++;
if(*p1==str2[i])
{
p1++;
i++;
if(*p1==str2[i])
{
p1++;
i++;
}
else
{
q++;
}
}
else
{
q++;
}
}
else
{
p1++;
q++;
}
*q=*p1;
}
i=0;
}
printf("%s\n",str);
}
main()
{
char str1[n],str2[]={"to "};
clrscr();
printf("please enter a text and includ 'to':\n");
gets(str1);
printf("remove 'to',remaining :\n");
del_char(str1,str2);
getch();
return 0;
}
Output:
please enter a text and includ 'the':
Write a c program to simulate the calculator using function
remove 'the',remaining :
Write a c program to simulate calculator using function
How add matrix by using function?
You simply add corresponding elements of the matrix. For example, add the first element of the first row in both matrixes, to get the first element of the first row in the result.
What are the different types of overloading allowed in c plus plus?
There are only two types: user-defined and compiler-generated. User-defined overloads are the ones you specifically write. Compiler-generated overloads are created by the compiler based upon a template function that you define. The only real difference is that with a template function you only need to write one version of the function, and the compiler will generate the actual overloads on an as-required basis. With user-defined overloads you must write each overload in full.
Template functions save a lot of time and maintenance, however they are only practical when the only difference between the overloads is the type of argument. That is, if the implementation is exactly the same regardless of type, then template functions are clearly a better option than writing out each overload by hand. Moreover, if you ever need to alter the implementation, there's only one function to modify.
The Do-While loop is what type of loop?
The do loop is similar to the while loop, except that the expression is not evaluated until after the do loop's code is executed. Therefore the code in a do loop is guaranteed to execute at least once. The following shows a do loop in action:
do {
System.out.println("Inside do while loop");
} while(false);
The System.out.println() statement will print once, even though the expression evaluates to false. Remember, the do loop will always run the code in the loop body at least once. Be sure to note the use of the semicolon at the end of the while expression.
What is the Difference between c and shell program execution?
The shell interprets the script, while the C-compiler generates a binary executable.