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

What is peep operation in stack using array in c?

I guess you mean operation top: return the topmost element without deleting it from the stack.

int top (const struct stack *from, stacktype *into)

{

if (from->elements==0) return -1; /* EMPTY */

*into = from->array[from->elements -1];

return 0; /* OK */

}

compare with pop:

int pop (struct stack *from, stacktype *into)

{

if (from->elements==0) return -1; /* EMPTY */

*into = from->array[from->elements -1];

--from->elements;

return 0; /* OK */

}

What is function Explain the user define function with example?

Function is a logically grouped piece of code allowing perform certain types of operations. Function can return value (int, double etc) or be void type - meaning they do not return value.

Functions allow to make code cleaner by moving out chunks of code of main body. For instance you want to write a function that finds area of rectangular.

#include <iostream>

using std cin;

using std cout;

using std endl;

using std get;

int main()

{

double sideA = 0.0;

cout << "Enter side a of rectagular: ";

cin >> sideA;

double sideB = 0.0;

cout << endl << "Enter side b of rectangular: ";

cin >> sideB;

//This part passes sides a and b to user defined function "Square"

cout << endl << "Area of rectangular is: " << Square(a, b);

cin.get();

return 0;

}

//definition of user defined function Square

double Square(double a, double b)

{

return (a * b);

}

In babyran a int or pow gz bow?

It seems like your question might have some typos or unclear references. If you're asking about "Baby Ran" in a specific context, please clarify what you mean by "int," "pow," and "gz bow." This will help me provide a more accurate answer.

WAP to read any two numbers and display largest of them?

Using if-else statement

#include<stdio.h>

#include<conio.h>

int main(void)

{

long int n,i;

clrscr();

printf("\n Enter any two nos.");

scanf("%ld%ld",&n,&i);

if(n>i)

printf("\nThe largest no. is=%ld",n);

else

printf("\nthe largest no. is=%ld",i);

getch();

return 0;

}

using ternary operator

#include<stdio.h>

#include<conio.h>

int main(void)

{

int n,i,a;

clrscr();

printf("\n Enter any two nos.");

scanf("%d%d",&n,&i);

a=(n>i?n:i);

printf("\nThe largest no. is=%d",a);

getch();

return 0;

}

What is the macros?

The micrometer is a precision measuring instrument, used by engineers. Each revolution of the rachet moves the spindle face 0.5mm towards the anvil face.

What is formula to find sum of n even numbers?

There is no formula that will sum n even numbers without further qualifications: for example, n even numbers in a sequence.

What are the data security threats and what controls can be put in place to curb the threats?

Historically, information security solutions have focused on preventing external threats such as viruses, hackers and worms through perimeter solutions that include firewalls and antivirus software. While still aware of outside threats, companies are now coming to understand they can no longer ignore inside violations concerning data at rest. So information security and privacy is of atmost importance whether it is internal or external.

Today's employees are able to easily export sensitive files and information via email or by copying to file shares and portable media without concerning about data security and data privacy. Many companies simply do not have the resources or appropriate policies in place to identify NPI and PII and avoid inadvertent, accidental mis-steps or malicious actions from within. As companies continue to accumulate NPI and PII, they are under enormous pressure to mitigate risk and to provide data security to sensitive information before an undesirable loss occurs. Whether you call it data security, Content Loss Prevention or simply Information Security solutions & Privacy, the time has come to take steps to protect your company's data privacy.

Deployed in under 30 minutes, the Kazeon's Information Server i.e. information security solutions system discovers sensitive information contained in emails and files regardless of physical or logical location.

What is difference between C and lisp?

If i know the answer i better open face book rather than this...

What is the advantage of an outline function?

Outline functions are primarily advantageous in debug code. By default, functions are never inline expanded in debug code (where NDEBUG is not defined) because debug code should never be optimised. This is simply because it much easier to map the assembly to the source code using outline functions.

In release builds (where NDEBUG is defined), functions are only inline expanded when there is an advantage in doing so. Trivial one-line functions are good candidates, as are complex functions that are only invoked in one place. Functions that increase code size are rarely good candidates so these will remain outline functions. Note that the programmer has no real control over which functions will be inline expanded. In particular, the inlinekeyword has had no bearing on inline expansion since 1998; it is used solely as a linkage directive when defining a non-member function in a header.

How do you change the color of background of output screen in c program?

Platform-dependent. For TurboC use functions of header conio.h (use built-in help).

What are the disadvantage of linker?

Linkers can introduce additional overhead during the linking process, potentially increasing build times, especially in large projects with many dependencies. They may also lead to larger executable sizes due to the inclusion of unnecessary code or libraries. Additionally, debugging can become more complex, as issues may arise from how different modules interact, making it harder to trace errors back to their source.

Write a Programs in C for Fabonic Series?

I am going to assume you want a program to print out the Fibonacci series.

#include <stdio.h>

int main(int argc, char **argv)

{

if (argc < 2) {

printf("Usage: %s max\n", argv[0]);

return -1;

}

int a = 1, b = 1, c;

int max = atoi(argv[1]);

printf("%d %d ", a, b);

while (b < max) {

c = a + b;

a = b;

b = c;

if ((b <= max)) printf("%d ", b);

}

printf("\n");

return 0;

}

Write a program to calculate the area of a circle?

#include<stdio.h>

void main()

{

int r=10;

float pi=3.14,c;

c=pi*r*r;

printf("Area of the circle=%f",c);

getch();

}