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 key word is use as identifire in c programming?

A keyword identifier is one whose meaning has already been declared to the C compiler and we can't use it as variable,because if we want to do so we are trying to establish a new meaning to the keywords which is not permitted.

How do you write a C program to check whether the number is odd or even Ps-using DEV complier?

To write a C program to determine if something is odd or even you need to be a programmer. To write a program in C is complicate and only done by programmers.

What is the function of Bootstrap program?

hi,

it is basically start up program that is responsible for locating lower hard disk addresses where operating system is stored

Who is the founder of C programming language?

C was developed by Dennis Ritchie at AT &T's Bell Laboratories of USA in 1972.

How do you end the c program with a new line?

Simply print a new line before invoking any return statement within the main function:

#include<stdio.h>

int main(void) {

// ...

printf ("\n"); // print a new line to the stdout device

return 0; // end the program (0 typically indicates no error)

}

Special character in C language?

special character in c language are as follows~ ' ! @ # % ^ & * () _ - + = | \ {} [] : ; " <> , . ? /

What are object oriented Programs?

There are two types of programmes related to objects that i know.

Pradip: object base means : realted only with object where u can find the encapsulation ,abstraction data hiding is possible but Inheritance,polymorphism, wil not be possible in case of object base programme. all are core object oriented programming.

What is diffrence between statement and expression in c?

well , in a rather simple way

an expression is a combination of of literals , variables , operators , functions calls which produces a particular value to be used in any other context

while a statement is an instruction to the computer telling it what to do for instance assigning an expression value to a variable , cause it produces an instructions tells the computer to assign a value to something.

to be more accurate , you can tell if A is a statement or an expression accurately by looking at the context which is been used in

well , in a rather simple way

an expression is a combination of of literals , variables , operators , functions calls which produces a particular value to be used in any other context

while a statement is an instruction to the computer telling it what to do for instance assigning an expression value to a variable , cause it produces an instructions tells the computer to assign a value to something.

to be more accurate , you can tell if A is a statement or an expression accurately by looking at the context which is been used in

What are the different types of array explain with examples?

There are two main types of array:

1) Single dimensional array: These are arrays for which only one index is required to access the element stored in an array. They are stored in a contiguous memory location.


Eg:


int arr[10];//declaration

arr[7] = 7;//initialization


2) Multidimensional array: These are arrays for which more than one index is required to access the element stored in a specific location in the array. These are stored in a contiguous memory location row-by-row.


Eg:


int arr[5][5];//two dimensional array

int arr[5][5][5];//three dimensional array

Use and importance of programming languages?

Answer If it weren't for computer languages where would we be today. Can you imagine writing a program as simply as writing a sentence instead of using computer language, it would be impossible. CD/delete means one thing, CD:/change direction and if the double dots aren't there the computer won't recognise the command. That's why so many people especially Computer Programmers spend years in Schools learning computer language so that the every day joe can't do their jobs.

Algorithm and flow chart of the program for ascending and descending order of numbers?

Use a looping structure. The first step initialises a loop control variable, n, to zero. You then begin the loop by processing the nth element from the array (the process may be a simple print statement). You then increment n. Finally, you test the value of n; if it is less than 10 you start a new iteration of the loop, otherwise you proceed to the end of the flowchart.

Write a c program to print the sizes and ranges of different data types in c?

#include<stdio.h>

#include<conio.h>

void main()

{

float f1,*Ptr1,*Ptr2;

ptr1 = &fl;

ptr2 = (&fl+1);

printf("%u",(char *)ptr2-(char *)ptr1);

getch();

}

What is the default value of integer in c?

For static and global variables it is 0; automatic variables are not initialized by default.

in the c language there is no default value for non static local variables. The variable holds whatever was in memory before it became a variable. It's best to always initialize a non static local variable before using it in the c language (or at least before comparing it to something else). Also It's best to assume that there is no default value because this varies from language to language, and hardware to hardware.

Cheers!

How do you swap 2 variables without using third variable?

void main() { int a,b; clrscr(); printf("\n\n\t\tenter any two nos..."); scanf("%d%d",&a,&b); a=a+b; b=a-b; a=a-b; printf("\n\n\t\tvalue of a=",a); printf("\n\n\t\tvalue of b=",b); getch(); }

What is mid level language?

A language that allows you to combine high-level programming with low-level programming. C and C++ are generally regarded as being mid-level languages.

Who is the owner of c language?

C language eveloped by Dennis Ritchie at the Bell Telephone Laboratories.

What is the difference between initialisation and definition in C programming?

Variable-declaration is:

extern int x;

extern double y;

extern char a;

Variable-definition is:

int x;

static double y;

auto char a;

Variable-definition with initialization is:

int x = 1;

static double y= 2.3;

auto char a = 'w';

How do you print numbers from 2 to1000 using while loop?

int i = 2;

while (i <= 1000) {

printf ("%d\n", i);

i++;

}

What is procedure language?

Answer

A procedural language is a programming language in which everything is processed in the order it appears to the computer.

In contrast, an object-oriented language is a language in which everything is processed depending on what happens in the program -- user input, errors, or other events.

PHP is both a procedural and object-oriented language, depending on the way it is used.

A java do while loop to count even numbers from one to ten?

The while loop is good for scenarios where you don't know how many times a block or statement should repeat, but you want to continue looping as long as some condition is true. A while statement looks like this:

while (expression) {

// do stuff

}

In this case, as in all loops, the expression (test) must evaluate to a boolean result. The body of the while loop will only execute if the expression (sometimes called the "condition") results in a value of true. Once inside the loop, the loop body will repeat until the condition is no longer met because it evaluates to false.

Any variables used in the expression of a while loop must be declared before the expression is evaluated. In other words, you can't say

while (int x = 2) { } // This is not legal

The key point to remember about a while loop is that it might not run at all. If the test expression is false the first time the while expression is checked, the loop body will be skipped and the program will begin executing at the first statement after the while loop. Look at the following example:

int x = 8;

while (x > 8) {

System.out.println("in the loop");

x = 10;

}

System.out.println("past the loop");

Running this code produces

past the loop

Because the expression (x > 8) evaluates to false, none of the code within the while loop ever executes.

What is the difference between AI and conventional programming?

Artificial Intelligence

*primary symbolic process

*Heuristic search

-steps are implicit

*Control structure usually separate from the domain knowledge

*usually easy to modify update and enlarge

*some incorrect answers are tolerable

*satisfactory answers usually acceptable

Conventional Programming

*numeric

*Algorithmic--steps are explicit

*information and control are integrated together

*difficult to modify

*correct answers are required

*best possible solution usually sought

How do you write a program in c to calculate age?

//program to find the age of given date of birth

#include <dos.h>

#include <stdio.h>

int main(void)

{

struct date d;

int bd,bm,by,day,m,y,cd,cm,cy;

clrscr();

getdate(&d);

printf("\t**********WELCOME TO AGE FINDER PLACE************\n");

printf("\t*************************************************\n\n");

cd=d.da_day;

cm=d.da_mon;

cy=d.da_year;

printf("Enter the birthe date : ");

scanf("d%d",&bd,&bm,&by);

{

if(cd<bd)

{

cm=cm-1;

cd=cd+30;

day=cd-bd;

}else

day=d.da_day-bd;

}

{

if(cm<bm)

{

cy=cy-1;

cm=cm+12;

m=cm-bm;

}else

m=d.da_mon-bm;

}

y=cy-by;

printf("your age is:-\n");

printf("year=%d\tmonth=%d\tday=%d\n",y,m,day);

getch();

}

//by DILKASH

from MANUU

What factors determine the structure and content of a training program?

The organizational structure, work activities, and informational content identified in a job analysis serve as the basis for developing both the structure and content of a training program