What is the Syntax of recursion in turbo c?
Nothing. A function may call itself just like any other function, eg:
int main (int argc, char **argv)
{
if (argc>0) {
puts (argv[0]);
main (argc-1, argv+1);
}
return 0;
}
Which modifications are necessary to generate dda dotted line code from dda algorithm?
What is the advantage of bresenham algorithm over dda algorithm?
Read more: What_is_the_advantage_of_bresenham_algorithm_over_dda_algorithm
A
Why insert operation in stack called as push operation?
Consider an array used as a stack. Align this array vertically. When an element is inserted into the stack, it is pushed all the way down despite the space availability at the top. Hence it is called push operation. Here's an illustration:
Stack initially:
|_|
|_|
|_|
|5|
Stack after the insertion of 6:
|_|
|_|
|6| - element pushed down as much as possible
|5|
Can you give an example of array program?
int main (int argc, char *argv[])
{
int i;
for (i=0; i<argc; ++i) printf ("%2d: %s\n", i, argv[i]);
return 0;
}
How do you write a program in c to display numbers from 0 to 9 along with the string?
#include <stdio.h>
int main (void)
{
puts ("0123456789");
return 0;
}
Length of a string using strlen?
char mystring[] = "This is a string"; int mystringlength = strlen(mystring); /* mystringlength is now 16 */
Why is there no threading for post order traversal of a binary search tree?
You don't need it. Think about it, you can just use a stack (or a recursive function.)
Which element of array does this expression refer num5?
which element of the array does this expression reference num[5]
How do you read and write a bmp file in VHDL?
Where f0.bmp is an eight square picture: This is OK up to the penultimate line can anyone resolve this bit/byte and perhaps post it on the Xilinx Virtex forum! See Xilinx forum on Virtex FPGA's http://www.xilinx.com/cgi-bin/SW_Docs_Redirect/sw_docs_redirect?locale=en&topic=support
Do you need to deallocate memory when an object is not in use?
Be more specific with your question:
Java: deallocation is always automatic
C++: objects allocated with new have to be released with delete
Which is preffered in C malloc or new why?
C does not have a new operator, so we must use the malloc function.
In C++ we prefer the new operator over malloc. The new operator not only allocates memory to an object, it invokes that object's constructor, thus ensuring correct initialisation of the object, thus establishing the object's invariant (if it has one). If construction fails for any reason, an exception will be thrown and no object will be instantiated. If the class designer has made correct use of resource acquisition is initialisation(RAII), any resources consumed by the constructor prior to throwing the exception will be automatically returned to the system, thus ensuring no resource leaks occur.
The sole purpose of malloc is to allocate memory and nothing more. If the allocation fails, a null pointer is returned, otherwise the start address of the allocation is returned. However, the memory is left in an uninitialised state even if the object has a constructor. Moreover, neither malloc, calloc nor realloc will throw exceptions so they are unsuitable for enabling RAII. The only reason they exist at all in C++ is simply for the sake of backward compatibility with C code which cannot use the new operator (since it does not exist in C).
How do you get loop the loops in theme park ds?
when you get bonuses or when your making good money you put a bit of money in your ride research and say you put 1900 on it wait about 3-4 years and it should nearly be there if you are at the roller coaster
C programming are converted into machine language with the help of?
A software tool called a "compiler" translates C programs into the underlying machine language for the system you are using. The C program is called "source code" and the compiled program is called "object code".
If you compile a program that will run on a completely different type of system, then it's called "cross compiling." Cross compiling requires a special compiler. For example, when you compile an application for the iPhone, you're compiling it on an computer that uses an Intel processor, but the actual program will run on an ARM based processor.
A pointer to a function which receives nothing and returns nothing?
void (*funptr)(void);
void fun (void);
int main ()
{
funptr = fun;
funptr ();
}
Flow chart to compute the average of N number?
Where:
variable_A contains the first number, variable_B contains the second number, variable_Sum contains the sum of variable_A and variable_B, and variable_Ave contains the average of variable_Sum.
The last time I checked the LETTER "N" is not a number
Write a program to find the largest of n numbers in c?
Without Using Arrays
Program:
#include<stdio.h>
main()
{
int n,m,i,max;
printf("How many numbers(n) you going to enter:");
scanf("%d",&n);
printf("Enter the numbers:");
scanf("%d",&m);
max=m;
for(i=2;i<=n;i++)
{
scanf("%d",&m);
if(m>max)
max=m;
}
printf("The Largest Number is %d",max);
}
Output:
How many numbers(n) you going to enter:5
Enter the numbers:
25
410
362
5
56
The Largest Number is 410
With Using Arrays
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int max_num(int a[],int n);
int max,i,n;
int a[50];
clrscr();
printf("Enter n number:");
scanf("%d",&n);
printf("Enter the numbers:");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
max=max_num(a,n);
printf("The largest number is %d",max);
getch();
}
int max_num(int a[],int n)
{
int i,m=0;
for(i=0;i<n;i++)
{
if(a[i]>m)
m=a[i];
}
return m;
}
output:
Enter n number:10
Enter the numbers:
123
456
789
963
852
147
5
56
600
753
The largest number is 963
How do you program reverse letters using arrays in C plus plus?
char * RevString( char * str )
{
char * dup = strdup( str );
size_t len = strlen( str );
int x = 0;
int y = len;
while( x str[ x++ ] = dup[ --y ]; free( dup ); return( str ); } Note that you don't actually need this function since the standard built-in strrev() function reverses strings more efficiently than this.
How do you run dev-c plus plus on Windows 8?
I don't run either DevCPP or Windows 8. However, I did some checking around and found the following answers. The related links to them are provided beneath this answer.
1) Run DevCPP in Windows XP Compatibility Mode: right-click the icon and select "Run in earlier versions of Windows"
2) Update DevCPP (see the SourceForge related link below)
The problem seems to be that you're running an outdated version of MinGW GCC.
If neither of the above answers help, try a Web search for devcpp "windows 8" or devc++ "windows 8".
Also, keep in mind that Windows 8 is still in beta development, so expect errors and problems to crop up. I'd recommend sticking with earlier Windows versions until at LEAST a service pack gets released if you continue to encounter technical difficulties and are unable to find answers on the Web.
What multiplication fact can be found by using the arrays for 2x9 and 5x9?
The multiplication fact (singular, not plural 'facts') that can be found is 7x9 = 63.
Using the arrays,
a 2x9 array (2 rows of 9 items) and 5x9 array (5 rows of 9 items) is 63:
2x9 = 18
5x9 = 45
18 + 45 = 63