Just forget it, it was a question twenty years ago when we worked in MS-DOS with a 16/20 bit CPU.
Near pointers contain 16 bits, far pointers contain 32 bits (but only 1MB (or 1MB+65520 bytes) are really addressible).
Which compiler is best for graphics programming?
Graphics is platform-dependent, so you have be more concrete with your question, eg:
Q: Is there any C-compiler for MS-DOS that comes with a graphics library?
A: Yes, Turbo C, for example.
What are the differences between call by value and call by reference in c plus plus?
Pass By Reference :
In Pass by reference address of the variable is passed to a function. Whatever changes made to the formal parameter will affect to the actual parameters
- Same memory location is used for both variables.(Formal and Actual)-
- it is useful when you required to return more then 1 values
Pass By Value:
- In this method value of the variable is passed. Changes made to formal will not affect the actual parameters.
- Different memory locations will be created for both variables.
- Here there will be temporary variable created in the function stack which does not affect the original variable.
What is average case complexity of binary search?
Habibur Rahman (https://www.facebook.com/mmhabib89)
BUBT University Bangladesh
http://www.bubt.edu.bd/
Is sql language is case sensitive?
No, SQL is not defined as case-sensitive in the standards.
However, certain implementations of SQL may be case sensitive, in certain scenarios. Notably, MySQL on a Linux or Unix server is most likely case sensitive in regards to table names. Also, some collations (string storage formats) are case sensitive. Finally, column and table names may be case sensitive within a query on some SQL servers (i.e. "select * from USER where user.name = 'test'" might result in an error). When it doubt, check the manuals for the server you are using.
What is the Use of main function in c language?
Any program source has to identify a memory location as the start of the program. The OS transfers control to this point of the program or module.
In case of C programs, the starting module is NOT your program, but another initialisation routine, which has name lis c0s.obj, c0l.obj etc. This routine after doing initial housekeeping work, like storing program name, arguments, environment variables etc. in the stack, calls a routine by name main.
How else are we going to tell the OS where to start ?
At the end of executing the main() function, the control goes back to the routine from which the main was called and then to OS, which terminates the program.
Why were high-level languages developed?
Because machine-language programming is extremely time-consuming, programmers began using English-like abbreviations to code the programs. High-level languages were developed to improve programming efficiency by requiring fewer coding statements.
It starts with a boolean (true or false) expression. If the expression evaluates to true then the following statement or block of statements is run.
For example:
int num = 5;
while (num < 9) {
<code that does something goes here>
num++;
}
In this example the contents of the while loop will be executed 4 times
Write a program to generate the Fibonacci Series using array?
#include<stdlib.h>
#include<conio.h>
#include<stdio.h>
void main (void)
{
clrscr();
int i;
int a[10];
a[0]=0;
a[1]=1;
printf("First 10 Fibonacci numbers are :\n");
printf("%d\n%d\n",a[0],a[1]);
for(i=2;i<10;i++)
{
a[i]=a[i-1]+a[i-2];
printf("%d\n",a[i]);
}
getch();
}
Which data structure allows deleting data elements from front and inserting at rear?
A linked list is an example for a data structure that allows removal from one end and insertion of new items to the other. Many other data structures support the same operations. They differ in what else they can do, and how efficient the operations can be performed.
C program to check given number is a perfect square or not?
#include <stdio.h>
#include <math.h>
int main(void)
{
int number;
double result;
printf ("\n Introduce an integer: ");
scanf ("%i", &number);
result= sqrt (number);
if ((result * result)== number)
printf ("\n The integer HAS a perfect square \n\n");
else
printf ("\n The integer DOES NOT HAVE a perfect square \n\n");
getch ();
}
Shrikanth Ganure
The Oxford College of Engineering (MCA-2010 Batch)
Bangalore..
Distinguish between the concept assembler compiler and interpreter?
Compiler -- reads human-readable source code, produces machine-executable binary code. Examples are C, COBOL, Java, etc. Easiest for humans to program, but does not always produce the most efficient executables.
Interpreter -- Reads human-readable code, line at a time, and produces and executes machine instructions "on the fly". Example is good old BASIC. Good for testing, but is VERY slow.
Assembler -- Converts machine-manipulation coding directly into binary machine instructions. Produces the most efficient executables, but is the most difficult (for humans) to work with.
Best of all worlds (my opinion) is C on Unix, for speed, ease of use, program efficiency.
What language can a computer always understand?
I have only a vague understanding of your question, but I'll take it as "why computers can understand language". :P.
- they don't
-they only seem to cause it was written in their program.
if it meant "what language computers understand",
-programming language.
-go search up wikipedia on this one.
How do you use Graph in data structure?
Em depends on the points your plotting on the graph. If they are evenly distributed then it's probably a linear graph.
How will be the c program for reversing first n characters in a file?
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <process.h>
void main(int argc, char *argv[])
{
char a[15];
char s[20];
char n;
int k;
int j=0;
int i;
int len;
FILE *fp;
if(argc!=3)
{
puts("Improper number of arguments.");
exit(0);
}
fp = fopen(argv[1],"r");
if(fp == NULL)
{
puts("File cannot be opened.");
exit(0);
}
k=*argv[2]-48;
n = fread(a,1,k,fp);
a[n]='\0';
len=strlen(a);
for(i=len-1;i>=0;i--)
{
s[j]=a[i];
printf("%c",s[j]);
j=j+1;
}
s[j+1]='\0';
getch();
}
Give an example of pseudocode program?
Pseudocode is a non-specific programming language that is used to outline an algorithm's logic using plain-English terms and sentence structures, but often incorporating the grammar of well-known programming constructs such as loops and branches.
For example, the following pseudocode demonstrates a loop that prints the values from 1 to 10:
let number be 0
repeat while number is less than 10
increment number
print number
This is a simple example, however anyone familiar with at least one programming language can translate this pseudocode into their chosen language without too many problems. The point of pseudocode is to reduce complex algorithms to their simplest form, without being overly-specific with regards an actual programming language. That is, the focus is purely upon the algorithm itself, rather than the idiosyncrasies of specific coding methods.
Pseudocode is not a programming language, per se, so there are no grammar rules regarding syntax or sentence structure. However, each line of code should be short and to the point (not overly-wordy), clearly conveying the point of the code. Whitespace and indentation should be used wherever necessary to convey the separation of code blocks (as shown in the example), or to break down complex lines into bite-size chunks that clearly show the logic.
Write a program To print the reverse order of a string?
//code for reverse string
class ReverseString
{
public static void main(String arg[])
{
StringBuffer s=new StringBuffer("abcdef");
System.out.println("Before reversing :"+s);
s.reverse();
System.out.println("after reversing.."+s);
}
}
Which symbol is used as a statement terminator in C?
semicolon ';' (Not applicable for block-statements)
What is the difference between switch case and if else?
If else can have values based on constraints, where as switch case can have values based on user choice.In if else, first condition is verified, then it comes to else whereas in the switch case first it cheaks the case and then it switches to that particular case.
Quick Sort
What do you mean by prototype of function?
Building a prototype allows the designer to explore unforeseen problem areas before building the finished product. Prototypes can also be used for testing to see how a device will operate in real-world conditions as opposed to computer projections, and to determine production cost and propose a budget.
Write a program to implement stack in openGL?
Module Module1
Sub Main()
myQuequeue()
myStack()
Console.ReadLine()
End Sub
Private Sub myQuequeue()
Dim theQ As New Queue
Dim dStr, frmstrArr() As String
Dim i As Integer
frmstrArr = FillArr()
For i = 0 To 25
theQ.Enqueue(frmstrArr(i) + " queue")
Next
For i = 0 To 25
dStr = theQ.Dequeue()
Console.WriteLine(dStr)
Next
End Sub
Private Sub myStack()
Dim theStack As New Stack
Dim dStr, fStr() As String
Dim i As Integer
fStr = FillArr()
For i = 0 To 25
theStack.Push(fStr(i) + " stack")
Next
For i = 0 To 25
dStr = theStack.Pop()
Console.WriteLine(dStr)
Next
End Sub
Private Function FillArr()
Dim strArr(25) As String
strArr = New String() {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
Return strArr
End Function
end module
What is the difference between int main and int void?
int main() refers that main function returns an integer value, where the integer value represent the program execution status. This status value is sent to the Operating System. If you follow strictly follow the rules, then it should be int main not void main()
How does syntax affect setting?
Syntax is essential to any form of language. Without syntax, there is no setting, there is no way to explain it and no language. Language and setting are both comprised with syntax.
Write a C program to display days in a week using single dimension array?
In any programming language, an array is a list of items ordered sequentially (one after another).
C arrays require that each item in an array is of the same type. To declare an array called intlist of ten integers, for instance, the following statement is used:
int intlist[10];
You can access the first item in intlist by using intlist[0], since all array indexes in C are zero-based. The last item is accessed using intlist[9] - 0 to 9 makes for 10 total integers.
A string, like a day of the week for instance, in C is an array of characters. C treats all strings as zero-terminated or NUL-terminated - the last index contains the value 0, which is called NUL (which is not to be confused with NULL, with two L's, which is used for pointers).
The following two string definitions result in the same data:
char hellostr[6]="Hello";
char hellostr[6]={'H', 'e', 'l', 'l', 'o', 0};
Alternately, and this is under C, you can also use:
char *hellostr="Hello";
Under C++, you would need to use:
const char *hellostr="Hello";
But that's outside the realm of this discussion.
What this does is forces the compiler to allocate memory for "Hello" (a string constant) followed by the value 0 (zero), and then point hellostr to the location of that string constant.
That takes care of strings. Now, for arrays of strings.
What the exercise is expecting you to do is store the name of each day in a week (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday and Saturday) in a string. This requires an array of 7 strings.
Because a string is an array of characters, you will need an array of an array of strings. Fortunately, string constants come to the rescue. If I wanted to store a list of colors, I could use the following definition:
char *colorlist[6]={"Red", "Orange", "Yellow", "Green", "Blue", "Purple"};
Then use the following code to access the colors in a loop:
for (count=0; count<6; count++)
printf("%s is a fine color!\n", colorlist[count]);
All you have to do now is code the main() function, replace some strings, add a variable declaration, compile, test and debug as required. Be sure to rename the variable colorlist as well to avoid confusion,
See the related links below for some handy C tutorials. Choose one (or more) which best suit(s) your needs.