answersLogoWhite

0

📱

C Programming

Questions related to the C Computer Programming Language. This ranges all the way from K&R to the most recent ANSI incarnations. C has become one of the most popular languages today, and has been used to write all sorts of things for nearly all of the modern operating systems and applications. It it a good compromise between speed, power, and complexity.

9,649 Questions

Why you cannot have full control over computer hardware when programming in high level language?

The higher level languages simplify instructions that could have taken many steps in a low level language. So puts("hello"); could be 20 instructions in assembler. So through this simplification, you lose a degree of control, depending on how high the language is.

What is .rft?

A .rft stands for Rounds For Time. In a .rft workout, one has a set amount of work to do and how long it takes to accomplish these tasks are stated.

Sample c program printing output name address and age?

#include <windows.h> #include <stdio.h> void printstuff(char *Name, char *Address,int Age) { printf("Hi my name is %s, I live at %s and I am %d years old.\n",Name,Address,Age); } void main() { printstuff("John","1 john street",29); }

How do you write a C program that calculates parking charges for a given day?

#include minfee = 2; int main() { int car1,car2,car3,hour,hour2,hour3,charge1,charge2,charge3, totalhour,totalcharge,minfee; printf("Enter car number\n"); scanf("%d", &car1); printf("How many hour did the car park\n"); scanf("%d", &hour); if (hour>=3) { charge1 = (minfee+hour*0.50); } else { charge1 = 2.00; } printf("Enter car number\n"); scanf("%d", &car2); printf("How many hour did the car park\n"); scanf("%d", &hour2); if (hour>=3) { charge2 = (minfee+hour*.50); } else { charge2 = 2.00; } printf("Enter car number\n"); scanf("%d", &car3); printf("How many hour did the car park\n"); scanf("%d", &hour3); if(hour>=3) { charge3 = (minfee+hour*0.50); } else { charge3 = 2.00; } totalhour=(hour+hour2+hour3); printf("%d", totalhour); totalcharge=(charge1+charge2+charge3); printf("%d", totalcharge); return 0; }

What do the hardware and software form together?

Answer

Hardware performs the computations, software is a set of instructions we use to tell the hardware what we want it to do.

Basically hardware is what carries out the work, and software is what we use, and what we program into it.

how does hardware work?

If the Q. is what is the HW-SW interface which enables us to use both of them as a system, i would say the instruction set.

The Instruction set is the HW-SW interface , instructions are "signals" for the hardware and at the same time appear as instructions to the programmer.This is the bridge between and us the machine.

How can usability of MS Access be improved?

Just a few ideas:

-Speed could be improved

-Space of storage could be increased

-Type of data inserted could be varied

-Ways of importing info could be more, so you can import from different places.


Hope this helps...

Write a program in c to display isosceles triangle dy digit?

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,c;

clrscr();

printf("\n Enter the 3 sides of Triangle: ");

scanf("%d %d %d",&a,&b,&c);

printf("\nYour entered side is a=%d b=%d c=%d",a,b,c);

if(a==b && b==c && a==c)

{

printf("\n EQUILATERAL TRIANGLE.");//All sides equal in case of Equilateral triangle

}

else if(a!=b&&b!=c)

printf("\n SCALENE TRIANGLE."); //All sides unequal

else

printf("\n ISOCELES TRIANGLE."); //At least 2 sides equal

getch();

}

What do NISHOT include?

NISHOT statistics include mistransfusion and ABO/Rh-incompatibility.

What is the semistatic character variable?

The semi static character variable is often the plot, if the plot changes, the semi static character may change as well.

What is Difference between tree and spanning tree?

A tree is a connected graph in which only 1 path exist between any two vertices of the graph i.e. if the graph has no cycles.

A spanning tree of a connected graph G is a tree which includes all the vertices of the graph G.There can be more than one spanning tree for a connected graph G.

How do you write a program to join two strings?

#include<stdio.h>

#include<conio.h>

main()

{

char s1[20],s2[20];

printf("enter first string");

scanf("%s",s1);

printf("enter second string");

scanf("%s",s2);

string_concatenate(&s1,&s2);

}

count_characters(char *x)

{

int i=0, count=0;

for(i=0;*(x+i)!='\0';i++)

count++;

return count;

}

string_concatenate(char *s1,char *s2)

{

int i,j;

char s3[50];

for(i=0;i

s3[i]=s1[i];

for(j=0;j

s3[i+j]=s2[j];

s3[i+j]=s2[j];

printf("%s",s3);

getch();

}

Does mentioning the array name gives the base address in all the contexts?

Mentioning the array name in C or C++ gives the base address in all contexts except one.

Syntactically, the compiler treats the array name as a pointer to the first element. You can reference elements using array syntax, a[n], or using pointer syntax, *(a+n), and you can even mix the usages within an expression. When you pass an array name as a function argument, you are passing the "value of the pointer", which means that you are implicitly passing the array by reference, even though all parameters in functions are "call by value".

There is, however, one very important distinction. While an array name is referentially the same as a pointer, it is not a pointer in that it does not occupy program referential space in the process. This means that, while you can change the value of a pointer, and thus the address to which it points, you can not change the value of an array name. This distinction is what we call R-Value (array or pointer) as opposed to L-Value (pointer only), i.e. can the object appear on the left sign of an assignment operator.

What is the remote programming procedure on a 2000 trans am?

hold down the lock and unlock buttons down at the same time for about 8 seconds on the remote. this should re-set the code.

Do you use a capital K or a lower case k when writing 100k?

While most folks would understand either, the proper usage is a lowercase 'k'.

It depends on what 'k' (or 'K') means. Kelvin? Kilo? Kilobinary? Something else?

Write a program that prints the letter X composed of asterisks?

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

void draw_x(int width, int height);

int main(int argc, char *argv[]){

int width, height;

if(argc != 3){

printf("Syntax: this_program width height\n");

exit(1);

}

width = atoi(argv[1]);

height = atoi(argv[2]);

// make sure they're both positive non-zeros

if(height > 0 && width > 0){

draw_x(width, height);

}else{

printf("numbers must be naturals\n");

exit(1);

}

return 0;

}

void draw_x(int width, int height){

int tally = 0;

int drawx, drawy;

char grid[height][width + 1];

memset(grid, ' ', height * (width + 1) * sizeof(char));

if(width > height){

drawy = 0;

for(drawx = 0; drawx < width; drawx++){

tally += height;

if(tally > width){

tally -= width;

drawy++;

}

grid[drawy][drawx] = '*';

grid[drawy][width - drawx - 1] = '*';

}

}else{

drawx = 0;

for(drawy = 0; drawy < height; drawy++){

tally += width;

if(tally > height){

tally -= height;

drawx++;

}

grid[drawy][drawx] = '*';

grid[drawy][width - drawx - 1] = '*';

}

}

for(drawy = 0; drawy < height; drawy++){

grid[drawy][width] = 0;

printf("%s\n", grid[drawy]);

}

}

Can you get me a c program to get the multiplication table for given n numbers?

#include
#include
void main()
{
void mul(int n);
clrscr();
mul(5);//Number to print the Multiplication Table
getch();
}
void mul(int n)
{
int i;
for(i=1;i<=10;i++)
{
printf("%2d * %2d = %2d\n",n,i,n*i);
}
}

Write a c program that reads ten integers and prints the first and the last numbers on one line and second and ninth on one line and so on....?

#include <cstdio>

int main()

{

int x[10];

printf("Enter 10 integers: \n");

for(int i = 0; i < 10; i++)

{

scanf("%d", &x[i]);

}

for(int i = 0; i < 10; i++)

{

printf("%d, ", x[i]);

}

char wait;

scanf("%s", wait);

return 0;

}

How do washers function using Dialogic?

The machine only needs to be loaded, and told what is the most delicate garment in the wash. It then evaluates other wash factors to create the "perfect" wash--lowest possible noise, cleanest rinse, appropriate detergent, and appropriate water usage

How do you draw Logic Gates in C language?

The C language is not a graphics language and you cannot draw logic gates using it. C is a programming language, and it is possible to use a graphics library to do so, but you did not specify which library you were using. Please restate the question.