C

Topic: C basics

What's the difference between a null pointer, a NULL macro, the ASCII NUL character and a null string?

Ans: A null pointer is a pointer which doesn't point anywhere. A NULL macro is used to represent the null pointer in source code. It has a value 0 associated with it. The ASCII NUL character has all its bits as 0 but doesn't have any relationship with the null pointer. The null string is just another name for an empty string "".System UtilitySparse Matrix...A sparse matrix is one where most of its elements are zero. There is no precise definition as to know whether a matrix is sparsed or not, but it is a concept which we all can recognize intuitively. The natural method of representing matrices in memory as two-dimensional arrays may not be suitable forsparse matrices. That is one may save space by storing only those entries which may be nonzero. If this is done, then the matrix may be thought of as an ordered list of non-zero elements only. Information about a non-zero element has three parts:an integer representing its row,an integer representing its column and the data associated with this element.That is, each element of a matrix is uniquely characterized by its row and column position, say i, j. We might store that matrix as a list of 3-tuples of the form (i, j, data), as shown below,Although the non-zero elements may be stored in the array in any order, keeping them ordered in some fashion may be advantageous for further processing. Note that above array is arranged in increasing order of the row number of non-zero elements. Moreover, for elements in the same row number, the array is arranged in order of increasing column number.

Browse random answers:

What is the output of printf(“%d”)?
What is the difference between const char *p, char const *p, and char* const p ?
What's the difference between a null pointer, a NULL macro, the ASCII NUL character and a null string?
Can we get the remainder of a floating point division ?
How to write a swap( ) function which swaps the values of the variables using bitwise operators.
Is there any difference between the two representations?
main(){             int c[ ]={2.8,3.4,4,6.7,5};             int j,*p=c,*q=c;             for(j=0;j<5;j++) {                        printf(" %d ",*c);                        ++q;     }             for(j=0;j<5;j++){printf(" %d ",*p);++p;     }}
Why doesn’t this code: a[i] = i++; work?
Write a pro gramme to show bubble sort on a set of 10 numbers?
How do I write code that executes certain function only at program termination?
Is NULL always defined as 0?
Find the output of followingmain(){float me = 1.1;double you = 1.1;if(me==you)printf("I love U");elseprintf("I hate U");}
What are storage memory, default value, scope and life of Automatic and Register storage class? 
Nesting of loops in C may continue upto how many levels?
What are storage memory, default value, scope and life of Static and External storage class? 
Write a function to swap any two numbers? 
Which expression always return true? Which always return false? 
Can we change the system date to some other date?
Give some explanation for "for" LOOP ON C LANGUAGE? 
How to print 1 to 100 without using any conditional loop?
Can we get the process identification number of the current program?
C Program to print the following series:11 21 2 31 2 3 41 2 3 4 5
Write a pro gramme to show bubble sort on a set of 10 numbers? 
How to set the system date through a C program ?
How can we find out prime numbers from 1 to 50? 
Can we use scanf( ) function to scan a multiple words string through keyboard?
How to decide even and odd values without decision making loops? 
Why the output of sizeof ( 'a' ) is 2 and not 1 ?
write c program fibbonaci series program?
Explain with an example the self-referential structure.  
Describe structures and Union in brief.  
How to extract the integer part and a fractional part of a floating point number?
How to build an expression trees ?
What's the difference between a null pointer, a NULL macro, the ASCII NUL character and a null string?
How do I get the time elapsed between two function calls ?
How do I write a program which can generate all possible combinations of numbers from 1 to one less than the given number ?
How can we read/write Structures from/to data files?
When should you use a type cast?
What are the advantages and disadvantages of external class?
Define recursion in C.  
Differentiate Source Codes from Object Codes
How can you increase the size of a dynamically allocated array?
What is the difference between i++ and i+1 ? 
How will you allocate memory to double a pointer?
What is the purpose of main( ) function ?
What is the simplest sorting method to use?
How to distinguish between a binary tree and a tree?
What is a stack ?
What are memory models?
How does C compiler store elements in a multi-dimensional array?
If the result of an _expression has to be stored to one of two variables, depending on a condition, can we use conditional operators as shown below?( ( i < 10 ) ? j : k ) = l * 2 + p ;
What are stdin, stdout, and stderr?
How do I use the function ldexp( ) in a program?
What value is yielded by a relational expression?
How do I print the contents of environment variables?
– Is the unary minus operator (-) the same as the subtraction operator (-)?
How do I convert a floating-point number to a string?
 What can the %lu format specifier do?
 What will be output when you will execute following c code?#include<stdio.h>void main(){     int check=2;     switch(check){        case 1: printf("D.W.Steyn");        case 2: printf(" M.G.Johnson");        case 3: printf(" Mohammad Asif");        default: printf(" M.Muralidaran");     }}
Which of the following correctly shows the hierarchy of arithmetic operations in C?
What is automatic type promotion in c?
Which of the following is the correct usage of conditional operators used in C?
Declare a pointer which can point printf function in c.
Which of the following is the correct order if calling functions in the below code?
What are merits and demerits of array in c?
Which of the following are unary operators in C?
 Is C a great language, or what? Where else could you write something like a+++++b ? 
What will be output when you will execute following c code?#include<stdio.h>void main(){    int a=5,b=10,c=1;    if(a&&b>c){         printf("cquestionbank");    }    else{         break;    }}a) cquestionbank b) It will print nothingc) Run time errord) Compilation errore) None of the above
How would you use the functions fseek(), freed(), fwrite() and ftell()?
What does static variable mean?
What is the simplest sorting method to use?
Difference between syntax vs logical error?
What will the preprocessor do for a program?
What is preincrement and post increment?
Way to minimize a last dimension regarding executable?
Write a program to interchange 2 variables without using the third one?
How much does static varied signify?
Way to minimize a last dimension regarding executable?
Difference between *p and **p?
Difference between pass by reference and pass by value?
What are enumerations?
Write a code for implementation of doubly linked list with use of single pointer in each node?
What is the use of typedef?
what are C tokens?
What are C identifiers?
What is preincrement and post increment?
What are bit fields? What is the use of bit fields in a Structure declaration?
 Is it possible to have more than one main() function in a C program ?
Why n++ executes faster than n+1 ?
What will the preprocessor do for a program ?
What is a data type?
What will happen if any string in c is converted to integer explicitly?
Write a program to find the greatest of three numbers.
Write a program to check whether a given number is a prime.
Write a program to find the greatest among ten numbers.
Write a program to generate the fibonacci series
Write a program to display the multiplication table of a given number.
What is the difference between ‘break’ and ‘continue’ statements?
What is the difference between getchar and scanf functions for reading strings?
What is the difference between declaring a variable and defining a variable?