What are the three interpretations for null values?
In a database it can be 'not known' or 'not applicable'.
Turbo c program code for asterisk pyramid pattern?
void main()
{
char userid[]="user",password[]="password",p[15],u[15];
int n=1,a,b;
printf("\nEnter username and password below (You have only three chances to enter)");
getch();
while(n<=3)
{
system("cls");
printf("\nUsername: ");
scanf("%s",u);
printf("\nPassword: ");
scanf("%s",p);
What is theprogram to generate n Fibonacci numbers n please explain each statement?
Program to Print Fibonacci Series
#include
#include
void main()
{
int n,i,f1=0,f2=1,f3;
clrscr();
printf("Enter n number : ");
scanf("%d",&n);
printf("%d\t%d",f1,f2);
for(i=3;i<=n;i++)
{
f3=f1+f2;
printf("\t%d",f3);
f1=f2;
f2=f3;
}
getch();
}
Output :
Enter n number : 10
0 1 1 2 3 5 8 13 21 34
How to determine an almost complete binary tree is a heap?
A binary heap is defined as follows: # It it an "almost" complete binary tree. That is, the bottom level of a heap of height h is partially filled from left to right, and may only have from 1 to 2h nodes. This may make some of the nodes at level h-1 into leaf nodes. So a binary heap of height h may have anywhere from 2h to 2h+1-1 nodes. # It satisfies the heap property. Each node has some ordered value associated with it, like a real number. The heap property asserts that a parent node must be greater than or equal to both of its children. A binary heap is easily represented using an array, let's call it A[1..length(A)]. The size of the heap will be called heap-size(A) (obviously heap-size(A) <= length(A)). We can use the first element of the array, element #1, as the root of the heap. The left child of array element i is at element 2i, and the right child is at element 2i+1. Also, the parent of an element at node i is at half of i. An element can tell whether it is a left or right child simply be checking whether it is even or odd, respectively. We define these "algorithms" for finding indices parents and children in pseudocode: Parent (i) return floor (i / 2) Left (i) return 2 * i Right (i) return 2 * i + 1 You can tell if an array element i is in the heap simply by checking whether i <= heap-size(A). Note: this scheme doesn't work in general with binary (possibly incomplete) trees, since representing leaf nodes at depths less than the height of the tree minus 1 isn't possible, and if it were, it would waste space. This representation of an almost complete binary tree is pretty efficient, since moving around the tree involves multiplying and dividing by two, operations that can be done with simple shifts in logic, and adding one, another simple instruction. Asymptotically speaking, each of the heap node access functions above consume O(1) time. ghjghjhjk hjkjk
How do you create a Pascal triangle using only one 'for' loop using C?
int factorial (int n)
{
if (n==0) return 1;
else return (n*factorial(n-1));
}
int combo (int n, int r)
{
return (factorial (n))/(factorial (r) * (factorial (n-r)));
}
int width(int n, int i, int j)
{
return(j==0?(((n+1)*2)-((i==0)?i:(i-j))):(j<=3)?j+1:j-1);
}
void print (int n)
{
int i, j;
for (i = 0; i<=n; ++i)
{
for (j = 0; j<=i; ++j)
{
printf ("%*d", width(n,i,j) ,combo (i, j));
if (i==j)
{
printf("\n");
}
}
}
}
int main ()
{
int row,col;
int maxrow;
printf("\nPlease enter the num of rows for pascal triangle : ");
scanf("%d",&maxrow);
printf("The Pascal Triangle for %d rows is :\n",maxrow);
print(maxrow);
printf("To get the value at any row, col please enter \nRow:");
scanf("%d",&row);
printf("Col:");
scanf("%d",&col);
printf("\nThe value at row %d & col %d is : %d\n",row,col,combo(row,col));
}
This is definitely a homework question (I'm working on it right now) so I think it's best that you answer this yourself. :)
How do you loop with Yamaha djx?
You cannot loop a sequence you have to play it out for as long as you want the beat to be. Or you can record 4-8 bars and record each track to a computer software program then manually loop them by copy & pasting. From there you can track, & mix a whole song with break downs and everything.
Back in the late 90s a friend of mine had this keyboard and he could remake any beat he heard on the radio but the downside was the keyboard didnt loop.
#include <stdio.h>
int main (void) {
unsigned f1, i1, f2, i2;
scanf ("Enter the 1st length in feet and inches: %u%u", f1, i1);
scanf ("Enter the 2nd length in feet and inches: %u%u", f2, i2);
unsigned inches = i1 + i2 + (12 * (f1 + f2)); // sum the inches (convert feet to inches)
unsigned feet = inches / 12; // convert inches to feet
inches %= 12; // determine the remaining inches
printf ("The total length is %u feet %u inches.\n", feet, inches);
return 0;
}
What is Multiprogramming in C language?
for(j = 1; j <= 12; j++)
{
printf("\nEnter an integer value:");
scanf("%d",&x);
if(x == 0)
y(j) = 0;
if(x != 0)
y(j) = 10;
}
What does implicit in c language means?
Implicit in c means compiler understands what and how to do without any reference of any keyword or token.
How does open source products relate in a programming language?
We have two kinds of programming languages, Open Source and Close Source :)
Open Source like javascript and Close Source ":)" like .exe files (Compiled Files)
Open Source files like javascript wont be compiled and will be used as it wrote. if you think php is open source or not, i should tell you it's a different thing, the first thing you should be worry about is the security, javascript is open source and open source files are less or even unsecured files, it means everyone can see your source code, they can break down your security easily..
So what you should do? USE SOME ENCIPHER PROGRAM TO MAKE IT HARDER TO BREAK DOWN (it will just make it harder.. not impossible)
Close Source (Complied Files) are those that you write an code then it will be complied to something else to be understand by computers, like you write c# codes in Visual Studio and when you want to run it, your codes will be compiled to an exe application, then your computer will be able to run it.
Compiled Files is more secure but keep it in mind it don't mean it's unbreakable.. nowdays there are reverse programs out there.. :)
Wish i got your question right.. :)
Are loop colostomies permanent?
A loop colostomy is most often performed for creation of a temporary stoma to divert stool away from an area of intestine that has been blocked or ruptured.
What is the statements written by the programmer are called?
They are called statements. They have no other special name. A group of statements are called "Block statements".
Models of distributed computer system?
•Minicomputer model (e.g., early networks)
-Each user has local machine
-Local processing but can fetch remote data (files, databases)
•Workstation model (e.g., Sprite)
-Processing can also migrate
•Client-server Model (e.g., V system, world wide web)
-User has local workstation
-Powerful workstations serve as servers (file, print, DB servers)
•Processor pool model (e.g., Amoeba, Plan 9)
-Terminals are Xterms or diskless terminals
-Pool of backend processors handle processing
Weddle's rule in C programming language?
Program of Matrix Chain Multiplication in c language?
# include <stdio.h>
# include <conio.h>
# include <stdlib.h>
# define sz 20
# define INF 200000
void print(unsigned long s[][sz], int i, int j)
{
if (i == j)
printf(" A%d ",i);
else
{
printf(" ( ");
print(s, i, s[i][j]);
print(s, s[i][j] + 1, j);
printf(" ) ");
}
}
void printm(unsigned long m[][sz], int n)
{
int i,j;
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
printf("%5d",m[i][j]);
}
printf("\n\n");
}
printf("\nThe No. of multiplication required is : %d",m[1][n]);
}
void Matrix_Chain_Order(int p[],int num)
{
unsigned long m[sz][sz] = {0};
unsigned long s[sz][sz] = {0};
unsigned int q = 0;
int i, j, k, l;
int n = num;
for(i = 1; i <= n; i++)
m[i][i] = 0;
for(l = 2; l <= n; l++)
for(i = 1; i <= (n - l + 1); i++)
{
j = i + l - 1;
m[i][j] = INF;
for(k = i; k <= j - 1; k++)
{
q = m[i][k] + m[k+1][j] + p[i-1] * p[k] * p[j];
if(q < m[i][j])
{
m[i][j] = q;
s[i][j] = k;
}
}
}
print(s, i-1, j);
printf("\n\n");
printf("The Minimum No. of Multiplication Required is:\n\n");
printm(m,n);
}
void main()
{
int i,num=0,p[sz]={0};
clrscr();
printf("Enter the number of matrix : ");
scanf("%d",&num);
printf("Enter %d no. of order sequence for %d matrix :\n",num+1,num);
for(i=0;i<=num;i++)
scanf("%d",&p[i]);
printf("\n\n");
printf("MULTIPLICATION SEQUENCE IS : ");
printf("\n\n\t");
Matrix_Chain_Order(p,num);
getch();
}
What do you mean by linearity in parameter and linearity in model?
Any model can be linear/nonlinear. Linearity can be in parameters or in variables.
In Y=a+ b*x1 + c*x2 + d*x3
the model is linear in both parameters (b,c,d) and variables(x1,x2,x3)
In Y=a+ (b+c)x1 + c*x2 + d*x3
the model is nonlinear in parameters (b,c,d) and linear in variables(x1,x2,x3)
In Y=a+ bx1 + c*x2*x3 + d*x3
the model is linear in parameters (b,c,d) and nonlinear in variables(x1,x2,x3)
In Y=a+ bx1 + c*x2*x3 + exp(b+d)*x3
the model is nonlinear in parameters (b,c,d) and nonlinear in variables(x1,x2,x3)
Does the C plus plus in computer language stand for Cobalt?
C was made in the 70s. Smalltalk was made in the 70s. Squeak was made in 1996, Croquet in 1999, and cobalt in 2007
C was the third in a progression of three languages named A, B, C, from what I heard
A is actually BCPL I think
BCPL B C C++ (P was taken for pascal p-code)
Unix was created first. The C programming language was created for Unix.
How can you determine the byte offset of a field within a structure?
For C++ you can do this:
#define member_offset(Struct, Field) (&(reinterpret_cast
because the byte offset is usually the structure address + offset, so by setting the address to 0, you get 0 + offset == offset.