Can you give an example of array using character variable in c program?
the example of array over charcter variables is char ["string"]
How do you make a calculator in code block by using c?
#include<stdio.h>
#include<conio.h>
int main(void)
{
float a,b,c=0, d=0, e=0,f=0;
printf("Please enter two numbers:\n");
scanf("%f %f", &a, &b);
c=a+b;
d=a-b;
e=a*b;
f=a/b;
printf("The sum of %f and %f is :%f\n", a,b,c);
printf("The subtraction of %f and %f is :%f\n", a,b,d);
printf("The multiplication of %f and %f is :%f\n", a,b,e);
printf("The division of %f by %f is :%f\n",a,b,f);
getch();
}
Why the header files have .h extension only?
Hi...
It's pretty simple. The .h stands for the word "header." It's merely a C convention that has been used throughout the years.
Conceivably, you could have "header" or "include" files with different extensions - the .h is the convention.
John
Why might you NOT want to implement paging in the DataGrid control as is?
You need to retrieve all of the data with each access to the page.
When we are talking about dereferencing in C we are talking about the pointers and how to get value from them, not address.
Dereferencing operator notation is "*".
Here is a simple example of dereferencing:
int num;
int pNum*;
pNum = # /* make pNum pointer point to numlocation in memory/stack */
*pNum = 7; /* setting pNum value to 7. Note! numvalue becomes 7 too, because pNum points to the same memory location as num */
Arrays whose size can be altered are known as?
Arrays whose size can be altered are known as dynamic arrays.
Using loop input 5 numbers and output its total sum?
Constant values are expressions as well, still I don't think they are so hard to evaluate... well, in this case it is twelve
How do you read binary file using c command?
FILE* f
f = fopen ("file name", "br");
... fread (f, ...);
fclose (f);
Find largest of n numbers using shell programming?
arg_cnt=$#
arg_list=$*
biggest=$1
if [ $arg_cnt -eq 0 ]; then
echo "$RF there should be minimum 1 argument"
exit 1
fi
for each_arg in $arg_list
do
if [ $each_arg -gt $biggest ]; then
biggest=$each_arg
fi
done
echo " Biggest number is : $biggest \n"
exit 0
it is prepared by auditor for taking action to complete their assignment in well manner.
C program for finding cube root of positive no?
#include "stdio.h"
#include "math.h"
int main()
{
double x;
printf("Enter the positive number.\n");
scanf("%lf", &x);
printf("Cube root of %lf is %lf.\n", x, pow(x, 1/3.0));
return 0;
}
What is the effect of dereferencing a null pointer variable?
You'd get a memory access violation. Nothing serious besides the fact that your program crashes (which is a good thing).
How do you print the elements of singly linked list-program?
#include<stdio.h>
#include<conio.h>
#include<alloc.h>
#define NULL 0
int item,ch;
struct slink
{
int data;
struct slink *next;
}
*start,*new,*l;
main()
{
clrscr();
start=NULL;
printf("\n**MENU**");
printf("\n1.CREATE \n2.PRINT \n3.EXIT ");
while(1)
{
printf("\nENTER YOUR CHOICE: ");
scanf("%d",&ch);
switch(ch)
{
case 1: create();
break;
case 2: print();
break;
default: exit();
break;
}
}
getch();
}
create()
{
start=NULL;
l=start;
printf("\nENTER THE DATA: \n");
scanf("%d",&item);
while(item!=0)
{
new=malloc(sizeof(struct slink));
new->data=item;
new->next=NULL;
if(start==NULL)
{
start=new;
l=new;
}
else
{
l->next=new;
l=l->next;
}
printf("\nENTER 0 TO TERMINATE: \n");
scanf("%d",&item);
}
}
print()
{
l=start;
while(l!=NULL)
{
printf("%d--> ",l->data);
l=l->next;
}
}
Constructor cannot be virtual but destructor can be virtual justify?
bcoz constructor cant be invoked
Can element of character arrays be accessed in the same way as the elements of a numeric arrays?
Yes, it can.
Why you divide a program into functions?
In order to make a large program more manageable, it is convenient to identify and isolate specific tasks that a program performs and to separate out those tasks into functions. These functions are used/invoked as needed by the main part of the program. They can also be invoked by other functions. Often a program will perform the same task in different parts of the program. Using a function to perform the task and invoking the function from the different parts of the program means that only one copy of the code is needed. This helps reduce the size of the program.
A physical node system refers to a tangible, identifiable unit within a network or distributed computing environment that performs specific functions or tasks. Each physical node, such as a server or device, is equipped with its own hardware resources like CPU, memory, and storage, and can communicate with other nodes. This system enhances scalability, reliability, and performance by distributing workloads across multiple physical nodes, allowing for better resource management and fault tolerance.
What do you mean by multiple compilation?
Whenever you change the source, you have to re-compile it, to get a new object/executable.