What is the difference between array element and variable?
• Array is the set of an multiple values where as variable can store single value at a time.
• The difference between the definition of array and ordinary variable is the, array is always declared, initialized, and accessed using subscript whereas ordinary variable do not have any subscript.
• The syntax for ordinary variable definition is data_type v1, v2, ….;
• And the syntax for array variable is data_type v1[N1],v2[N2],…; where v1,v2 are name of variable and N1, N2 are the integer constants indicating the maximum size of array.
What is a program to print the Fibonacci series in c plus plus?
Yes, you can. To generate the Fibonacci sequence, you start with the first two numbers in the sequence, usually 0 and 1. The remainder of the sequence is the sum of the previous two numbers in the sequence:
The following function will generate n terms of the sequence using first and second as the first two numbers in the sequence:
void fibonacci (int n, int first=0, int second=1) {
for (int term=0; term
int sum = first + second;
printf ("%d, ", first);
// prepare for next iteration...
first = second;
second = sum;
}
printf ("\b\b \n"); // backspace over final comma and overwrite with space
}
C is the third letter of the English alphabet. It is from the Latin letter C, which in old Latin represented the sounds of k, and g (in go); its original value being the latter. In Anglo-Saxon words, or Old English before the Norman Conquest, it always has the sound of k. The Latin C was the same letter as the Greek /, /, and came from the Greek alphabet. The Greeks got it from the Ph/nicians. The English name of C is from the Latin name ce, and was derived, probably, through the French. Etymologically C is related to g, h, k, q, s (and other sibilant sounds). Examples of these relations are in L. acutus, E. acute, ague; E. acrid, eager, vinegar; L. cornu, E. horn; E. cat, kitten; E. coy, quiet; L. circare, OF. cerchier, E. search., The keynote of the normal or "natural" scale, which has neither flats nor sharps in its signature; also, the third note of the relative minor scale of the same., C after the clef is the mark of common time, in which each measure is a semibreve (four fourths or crotchets); for alla breve time it is written /., The "C clef," a modification of the letter C, placed on any line of the staff, shows that line to be middle C., As a numeral, C stands for Latin centum or 100, CC for 200, etc.
Difference between direct sequential file and index sequential file?
Explain the difference between sequential and direct file access.
A. Sequential access to data is used when the data has to be read from the start, in sequence. It is the normal method of access for magnetic tape. Direct access is used when it is possible to jump directly to a file or data item without reading through all the items stored before it. This is the normal method used for hard disks.
What is the difference between String and String Buffer?
In Java, String is a class that represents an immutable string, that is a sequence of characters that can never change. Any modification to the String will have to create a new String object. A StringBuffer (and in Java 1.5 and up, a StringBuilder) is a mutable string object that can be modified at runtime.
The advantages of using Strings are that the String is generally lighter and faster to use where the String isn't going to change. When building a long String of text by making changes to one object over time, you should use a StringBuilder or StringBuffer (in Java 1.4 or when synchronization is important).
What are some basic programs in c language?
Traditional C programming follows the ECLG cycle: Edit (the source code), Compile (the program), Link the application and Go run it.
In truth, the ECLG cycle is a (ECLD)*CLG cycle: Edit, compile, link and debug. Repeat this until satisfied with the correct function, the create the final application with another compilation and linkage, and Go (ship, etc).
Write a program in C to find the factoial of 5?
/* gcc -ansi -Wall -Wextra -pedantic -s -static 0.c -o 0 */
#include <stdio.h>
int main ( )
{
int n = 5 , factorial = 1 ;
while ( n != 0 )
{
factorial *= n ;
n -- ;
}
printf ( "%i\n" , factorial ) ;
return 0;
}
It is an algorithm used by another algorithm as part of the second algorithm's operation.
As an example, an algorithm for finding the median value in a list of numbers might include sorting the numbers as a sub-algorithm: There are plenty of algorithms for sorting, and the specifics of the sorting does not matter to the "median value" algorithm, only that the numbers are sorted when the sub-algorithm is done.
For what an algorithm is, see related link.
How do you Write a C program for performing as calculator?
#include<stdio.h>
#include<conio.h>
void tax caluclation()
{
char name[20];
double sal,tax;
clrscr();
printf("enter the name of the person:\n");
scanf("%s",name);
printf("enter the name of the person:\n");
scanf("%lf",sal);
if(sal<=75000)
tax=sal*12.0/100;
else
tax=sal*16.0/100;
printf("the tax amount for %s is:%lf\n",name,tax);
}
void main()
{
tax caluclation();
}
no space b/w (tax caluclation) taxcaluclation
What is the difference between extern and global?
Extern and Global are the storage space in C program.
Global provides us to access the variables from anywhere inside the program only whereas Extern provides us to access the variables from outside that program, i,e., some other program.
Why do you use a void pointer in a programme?
void is type of pointer that usually means that you can make it point to any data type.
When you make a pointer point to somewhere its data type should match with the place where you want it to point.
When you dont know the data type where it will point to then you can declare a void pointer and make it point to the data type it want.
Write a c programme to find sum of individual digits of a given positive integers?
int sumDigits(int n) {
int sum = 0;
while( n > 0 ) {
sum += (n % 10); // add last digit of n to sum
n /= 10; // divide n by 10 to "chop off" the last digit
}
return sum;
}
____________________________________________________
C program to find the sum of entered digit: By Jatinder Pal SinghWrite a c program to find the roots of a quadratic equation using if else?
/*Hello!! I'm aditya From Bangalore I have the solution of this program*/
#include <stdio.h>
#include <math.h>
main()
{
float a,b,c,x1,x2,delta=0;
printf("enter the value of a,b,c\n");
scanf("f%f",&a,&b,&c);
delta=((b*b)-(4ac));
if(a=0)
{
printf("the variables cannot form a quadratic equation\n");
}
else
{
x1=(-b)+(sqrt(((b*b)-(4ac))/2a))
x2=(-b)-(sqrt(((b*b)-(4ac))/2a))
}
if(delta=0)
{
printf("the roots are real and equal");
}
if(delta>0)
{
printf("the roots are real and distinct");
}
if(delta<0)
{
printf("the roots are imaginary");
x1=(-b)+(sqrt(((b*b)-((4ac))/(float)(2a))
x2=(-b)-(sqrt(((b*b)-((4ac))/(float)(2a))
}
printf("the roots of the equation are %2.2f\n",x1,x2,delta);
}
/*the program is written by using simple-if and if-else constructs*/
Types of array in data structures?
There are many types of trees:
- binary trees
- binary search trees
- B+ trees
- red-black trees
- AVL trees
- suffix trees
- and much more....
Each have different rules for adding a new element, removing an element, and searching for an element in the tree. Consequently, they all have different advantages and disadvantages.
Write in intractive program to generate the divisors of a given integer in c?
#include <stdio.h>
void div(int n){
int i=2;
while(n%i!=0 && i!=n){
i++;
}
printf("%d ",i);
if(i!=n){
div(n/i);
}
}
main(){
int i;
printf("Enter number:");scanf("%d",&i);
printf("1 ");
div(i);
}
What is the c plus plus code for application of linked list in mobile phones?
If people started writing these codes here, then what software engineers will do?
What Machine language is an example of a high-level language.?
There is no program that can translate machine code to a high-level language. The best you can do is disassemble the code. This produces code that is similar to assembly language, but which lacks variable names and comments. Even a skilled programmer will need to spend hours disentangling the code in order to make it readable -- but you can never restore the code back to its original source code, no matter what language it was written in.
What is the function of the loop of Henie?
well urea salts crap like that is filtered through the glomerus were it then becomes filtrate (made up of the urea slats i think glucose too) it then travels down the loop of henley where the glucose is reabsorbed by the blood but the waste product are carried off to the bladder :)
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.