Learn C: C Basics

Topics: All about C Basics'

Browse all answers:

which one of the following is correct regarding to c is a structural or highlevel or middle level language ? 
What is the difference between #include  and #include ?file?? 
How to create love flames program using c language? 
How do you override a defined macro?
Can a file other than a .h file be included with #include? 
What is the difference between NULL and NUL? 
How can you avoid including a header more than once? 
Is it possible to execute code even after the program exits the main() function? 
Write the equivalent expression for x%8? 
Is it possible to print graphics output in C? 
What is the benefit of using #define to declare a constant ? 
What are the different storage classes in C ? 
The following variable is available in file1.c, who can access it?:static int average; 
What is a pragma?
What is the differece between #define and constant in C?
How to improve my c knowledge........
What is Preprocessor? 
Can you define which header file to include at compile time? 
How can C programs run without header files?
If compiler for c is written in c language, which is used to complie the compiler?
What is object file? How can you access object file? 
What are the characteristics of arrays in C?
Write a C program to print that a number is odd or even?
How to print value without using any output statements? 
Can you write a c program without using main function? 
What is :- Asembler , compiler , Preprocessor , laxical analysis , parsing ?
What is the difference between compile time error and run time error?
What is modular programming?
What are the features of C?
How to find a given number is armstrong number or not in "c".?
How to perform addition,subtraction of 2 numbers without using addition and subtraction operators?
Can we execute printf statement without using semicolan?
What are storage class in c?
which one will execute faster if(flag==0) or if (0==flag) and why? 
How do you print an address? 
How many levels deep can include files be nested? 
What will be printed as the result of the operation below:main(){int x=20,y=35;x=y++ + x++;y= ++y + ++x;printf(?%d%dn?,x,y);}
What is the difference between #include  and #include ?file? 
What is C language ?
How should functions be apportioned among source files?
I have a varargs function which accepts a float parameter ?
Why is this loop always executing once? 
My compiler isnt letting me declare a function? 
What is the diffrence between a "assignment operator" and a "copy constructor"?
How to find GCD of four numbers?
What is the best style for code layout in C? 
what is the line #include at the topof a c source file for ? 
What are the packages in c? 
Why two pointers cannot be added in c language? 
What will be printed as the result of the operation below:#define swap(a,b) a=a+b;b=a-b;a=a-b;void main(){int x=5, y=10;swap (x,y);printf(?%d %dn?,x,y);swap2(x,y);printf(?%d %dn?,x,y);}int swap2(int a, int b){int temp;temp=a;b=a;a=temp;return 0;}
What is the difference between #include< > and #include" " ?
What are the applications and advantages of C-language? 
Write a C program:Let n be a positive integer consisting of up to 10 digits, d10, d9, ... , d1. Write a program to list in one column each of the digits in the number n. The right-most digit, d1, should be listed at the top of the column.Hint: If n is 3,704, what is the value of the digit computed by using digit = n % 10;Show the expected output of your program for values of n equal to 6; 3,704; and 170,498.?
Can Any other language completely replace c? 
Is C a compiled language or interpreted language?
What are applications of C programming language?
When is a switch statement better than multiple if statements?
What is the output of printf(“%d”)?
Write a pro gramme to show bubble sort on a set of 10 numbers?
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");}
Nesting of loops in C may continue upto how many levels?
Write a function to swap any two numbers? 
Which expression always return true? Which always return false? 
Give some explanation for "for" LOOP ON C LANGUAGE? 
How to print 1 to 100 without using any conditional loop?
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 can we find out prime numbers from 1 to 50? 
How to decide even and odd values without decision making loops? 
write c program fibbonaci series program?
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 ;
How do I use the function ldexp( ) in a program?
How do I print the contents of environment variables?
How do I convert a floating-point number to a string?
 What will be output when you will execute following c code?#includevoid 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");     }}
What is automatic type promotion in c?
Declare a pointer which can point printf function in c.
What are merits and demerits of array in c?
What will be output when you will execute following c code?#includevoid 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?
Difference between syntax vs logical error?
What is preincrement and post increment?
Write a program to interchange 2 variables without using the third one?
Difference between pass by reference and pass by value?
What are enumerations?
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?
What is the difference between text and binary modes? 
What is the quickest searching method to use?
 Is NULL always defined as 0? 
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is the quickest sorting method to use ?
How would you insert pre-written code into a current program ?
In which standard library file is the function printf() located ?
The first expression in a for loop is ?
What are the types of constants in c?
What are the types of C intructions?
Can a Structure contain a Pointer to itself?
What is problem with Runtime type identification?
What is the differentiate between for loop and a while loop? What are it uses?
What is (void*)0?
In which header file is the NULL macro defined?
How many bytes are occupied by near, far and huge pointers (DOS)?
Find the output of following?#define square(x) x*xmain(){      int i;      i = 64/square(4);      printf("%d",i);}
Given the following program fragment?main (){   int i, j, k;   i = 3;   j =2*(i++);   k =2*(++i);}
How many times the below loop will runmain()    {     int i;      i = 0;    do    {         –i;          printf (“%d”,i);          i++;   } while (i >= 0)}
What would be the output if option = ‘H’?switch (option) {case ‘H’ : printf(“Hello”);case ‘W’ : printf(“Welcome”);case ‘B’ : printf (“Bye”);                 break;          }
Suppose a,b,c are integer variables with values 5,6,7 respectively.  What is the value of the expression:!((b + c) > (a + 10))?
How many times “Futurestuff4all.com” will get printed?Consider the following program,              main ()              {                     int i, j;                     for (i=0, j=5; j >0, i < 10; i ++, j–)                          printf(“nFuturestuff4all.com”);               }
What will be the output of the following program?main(){    printf(3+”Futurestuff4all”+4);}
What will be output when you will execute following ccode?#include#define var 3int main(){char *cricket[var+~0]={"clarke","kallis"};char *ptr=cricket[1+~0];printf("%c",*++ptr);return 0;}
What value of c will get printed?   main()   {         int a, b, c;         a = 10;         b = 20;         c = printf(“%d”,a) + ++b;         printf (“%d”,c);   } 
How many times the below loop will get executed?main() {          int i;         for (i=9 ; i ; i=i-2)         {           printf(“n%d”,i);         }     }
What will be the output? main(){   int i;   i = 10;   printf(“%dt”,5,6);   printf(“%d”, i , i++);}
What the below statement will print if a=10 and b = 20?printf(“ %d”,a==b);
What the below statement will print if a=10?printf(“ %d   %d”,a, !a++); 
What will be the output?   main()   {         int i;         i =10;         if (i ==20 || 30)          {              printf(“True”);           }         else        {              printf(“False”);           }     }
What will be the output   main()   {          if (1,0)          {              printf(“True”);          }         else        {              printf(“False”);           }   }
What will be the output?   main()   {      int i , j ,*ptr, *ptr1;      i =10;      j = 10;      ptr = &i;      ptr1 = &j;       if (ptr == ptr1)      {          printf(“True”);      }     else     {          printf(“False”);     } }
How many times main()  will get called?main( ){         printf ( “\nMain called again” ) ;       main( ) ;}
Is the following code fragment correct?const int x = 10 ;int arr[x] ;
In the following declaration statement    char c=’A’;
How do I write code to retrieve current date and time from the system and display it as a string?
Why doesn't the following code give the desired result? int x = 3000, y = 2000 ;long int z = x * y ;
Sample C program To Print First Ten Numbers.
Sample C Program To Find The Area Of A Rectangle.
Sample C Program To Find The Sum Of N Numbers.
Sample C Program To Convert Celsius Temperature To Fahrenheit.
Sample C Program To Specify Size Of Commonly Used Data Types.
How to run DIR command programmatically?
How to obtain the current drive through C ?
How do I programmatically insert lines in the text window?
Explain about Information Hiding in C
How do I get the time elapsed between two function calls ?
Can we get the remainder of a floating point division ?
Variably Dimensioned Arrays
What is the value of sizeof(a) /sizeof(char *) in a code snippet:char *a[4]={"sridhar","raghava","shashi","srikanth"};
Which is the fastest sorting method you can use while programming in c language?
Discuss on pointer arithmetic?
How do I write code that would get error number and display error message if any standard error occurs?
How to determine the size of an allocated portion of memory?
How do I write a user-defined function, which deletes each character in a string str1, which matches any character in string str2?
How does a C program come to know about command line arguments?
When we open a file, how does functions like fread( )/fwrite( ), etc. get to know from where to read or to write the data?
How do I write a program to convert a string containing number in a hexadecimal form to its equivalent decimal?
Give example of some data types?
Can we get the x and y coordinate of the current cursor position ?
How does C compiler stores float values ?
How do I get the time elapsed between two function calls ?
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?
How do I write code that executes certain function only at program termination?
What are storage memory, default value, scope and life of Automatic and Register storage class? 
What are storage memory, default value, scope and life of Static and External storage class? 
Can we change the system date to some other date?
Can we get the process identification number of the current program?
How to set the system date through a C program ?
Can we use scanf( ) function to scan a multiple words string through keyboard?
Why the output of sizeof ( 'a' ) is 2 and not 1 ?
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 a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
How can I pad a string to a known length?
Write C code to reverse a string by recursion:?
Sample C Program On Strings Into Array Of Pointers
Sample C Program To Implement Recursive Algorithm Using Pointers.
Sample C Program To Accept A String & Display It.?
Write a program that returns 3 numbers from a function using a structure.?
What are the standard predefined macros ?
How can I search for data in a linked list ?
What are storage memory, default value, scope and life of Automatic and Register storage class?
What are stdin, stdout, and stderr?
What value is yielded by a relational expression?
– Is the unary minus operator (-) the same as the subtraction operator (-)?
 What can the %lu format specifier do?
Which of the following correctly shows the hierarchy of arithmetic operations in C?
Which of the following is the correct usage of conditional operators used in C?
Which of the following is the correct order if calling functions in the below code?
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 is an rvalue?
How many times the while loop will get executed if a short int is 2 byte wide?
#include<stdio.h>
int main(){ 
int j=1; 
while(j <= 255) {  
printf("%c %dn", j, j);j++; 
} 
return 0;
}
Which of the following cannot be checked in a switch-case statement?
Which of the following statements are correct about the program?
#include<stdio.h>
int main(){ 
unsigned int num; 
 int i; 
scanf("%u", &num); 
for(i=0; i<16; i++) { 
printf("%d", (num<<i & 1<<15)?1:0); } return 0;
}
Which of the following statements are correct about the program?
#include<stdio.h>
int main(){ 
unsigned int num; 
int c=0; 
scanf("%u", &num); 
for(;num;num>>=1) { 
if(num & 1) c++; 
} 
printf("%d", c); return 0;}
What is the simplest sorting method to use?
What will the preprocessor do for a program?
Way to minimize a last dimension regarding executable?
How much does static varied signify?
Can you tell me how to check whether a linked list is circular?
Way to minimize a last dimension regarding executable?
Difference between *p and **p?
Write a program to print infinite number?
Write a code for implementation of doubly linked list with use of single pointer in each node?