-
What will be output of following program and how?
i=4; j=++i*++i; printf("%d", j); My Ans-30;
-
Output of ++i + ++i + i + --i?
What will be the output of ++i + ++i + i + --i when i=5? Compiler says output is 27. How?
-
Difference between b++ and b=b+1
What is the difference between b++ and b=b+1? Which one is more used and why?
-
Output for following and explanation
j=scanf("%d",&i); printf("%d",j);
-
Return Multiple Values at a time from Function
How can we return multiple values at a time from function using call by reference?
-
Variables Storage
Variables should be stored in local blocks. Yes or No?
-
which order the functions would be called?
In the following code, in which order the functions would be called? a= f1(23,14)*f2(12/4)+f3();
-
What is the difference in C and Java ?
why the c use only compiler ? while java used both interpreter as well as compiler ?
-
Program to print all prime numbers btw 1 to 100
C Program to print all prime numbers btw 1 to 100..pls explain the program: What is if(p)??{geshibot language="cpp"}#include #include int main() { int num,n,div,p; printf("Enter any number: "); scanf("%d", &num); for(n=2; n
-
-
removing duplicate words from a string
{geshibot language="c"}int main() { char arr[1000]; char *temp=NULL; char *temp1=malloc(100); int len; printf("enter the string: "); gets(arr); len=strlen(arr); puts(arr); printf("len:%d ",len); temp=strtok(arr," "); if(temp!=NULL) strcpy(temp1,temp); while(temp!=NULL) { temp=strtok(NULL," "); if(strstr(temp1,temp)==NULL) { strcat(temp1," "); strcat(temp1,temp); } } strcpy(arr,temp1); printf("arr:%s",arr); return...
-
Language
What is the difference b/w c & java?
-
Whats the output of.....>>?
#include #include void main() { int a=1; if(a=1,3,5,6) printf("good&a=%d",a); else printf("bad&a=%d",a); } }
-
language and scripting language
Explain the difference between language and scripting language?
-
Function syntax
string abc = showData()["Hello"]; can somebody explain what is use of ["Hello"] after function call?
-
pre and post increment operators
why does ++i * ++i give 49 when i=5?
-
getch function declaration
Can you please explain the declaration of getch() function that is "int getch(void)"? I have the doubt that if its return type is int, why is the character typed from the keyboard is displayed as it is? It should be displayed in its ASCII value. Also, what does void as parameter in this function stand for???
-
why integer range -32768 to 32768
why integer range -32768 to 32768 and actual meaning of storage size 2 bytes ?
-
Print number of distinct characters in a string.
How do I implement a C program that reads a string and prints a table with the number of occurrences of each character in the string. Ex: Rubber. r = 2, u = 1, b = 2, e = 1.
-
-
decrement operator in C
int a=3,y; y=++a + a+++ --a+ ++a; printf("%d%d",y,a); Why value of y become 16.
-
Print colors with printf
Is it possible to print colors with printf statements ?
-
print the output as follows by a c program without using loops?
print the output as follows by a c program without using loops? 1 1 2 1 2 3 1 2 3 4 1 2 3 1 2 1
-
what is result for of this C Code block?
what is the result main() { int x=15; printf("%d %d %d",x!=15,X=20,X
-
Output of the C program
What is the output of the following code? {geshibot language="c"} #include void main() { int s=0; while(s++
-
Declare an array of N pointers
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
-
Using C, How will you search for a word in file ?
if i enter an ID Number it should look in the .txt file the employee who owns that ID Number then it will display it on the screen..
-
C is not platform dependent.Why?
we know that C is not platform independent.but if we make a program on a operating system and copy the same program on other os without any changes then this program will run after compiling and will give the same answer. so if same program will run on other os then why C is not platform independent.
-
How to compile a C Compiler
during developing of c language, they need to develop compiler for it,c compiler itself is written in c ok... then how did they compiled c compiler.....???????
-
Declare Array of N Pointers
How do you declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
-
Constant Variable Value
How will you change the value of a constant variable in C?
-
Convert Integer to String
How will you convert an integer to a string without using itoa() function?
-
Convert int to string
Convert int to string without using itoa in C language
-
Faster Statement Execute
Which one will execute faster if(flag==0) or if (0==flag) and why?
-
C question
How can you change the value of a constant variable in C?
-
Pointers Datatype
What is the datatype of pointer?
-
Tricky C Program
Write a C program to find a peculiar two digit number which is three times the sum of its digits.
-
Pointer Use
Why do we use pointer instead of variable?
-
Pointer Disadvantages
What are the disadvantages of using pointer in C?
-
Pointer to an Array
What is pointer to an array? Explain with example.
-
Pointer Variable
How to declare and initialize a pointer variable?
-
Recursion
What is the basic principle behind recursion, other than function calling itself again & again and in which real time scenario we use it?
-
Pointers
Why do we need different types of pointers when it occupies the same memory space for any type of pointers?
-
Return Multiple Values from Function
How to return multiple values in C language function?
-
Error Code
Will this code cause an error during runtime, error during compilation, or no error? 1.) char str[5]; strcpy (str, "hello"); 2.) char *str; strcpy (str, "hello");
-
Double Pointer
What is a Double Pointer? What are its specific uses.
-
Read and Sort 30 integers into One Dimension Array
Write a C programme that read 30 integer numbers into one dimension array then using a function to sort them in desinding order (this function should use another function to exchange any two elements int the array) after that print desorted elements?
-
Null Pointers
What is the use of null pointers?
-
Pointer to Unsingned int
Why it is not possible to create pointer to unsingned int?
-
Maximum combined length of command line arguments in C
What is the maximum length of command line arguments including space between adjacent arguments ?
-
NULL Macro
What is NULL Macro? What is the difference between a NULL Pointer and a NULL macro?
-
fflush() in Multiple Scanf calls
What is the requirment of using fflush() in multiple scanf calls.
-
Field Width Specification
What is Field Width Specification?
-
What will be difference b/w 5th and 6th statements?
1. #define MAX 1002. main()3. {4. int max=100;5. int a[MAX];6. int b[max];7. }
-
Find address of variable
How to find the address of a variable which is declared as long double?
-
Where is the function declared as static stored in memory?
The usage of static with a function or variable restricts their scope.Is this behaviour memory related?
-
Short int and int
What is the difference between short int and int?
-
Types of Exceptions in C
What are all the type of Exceptions available in C ?
-
Output of a++ + ++a + a++
What is the answer of a++ + ++a + a++ int a=5;c = a++ + ++a + a++;//compiler produces the answer 28!!!//How
-
Nested if statement
How many nested if statements are allowed in C?
-
-
-
-
-
-
-
What is the output of the following sample C Code
int *ptr = (int *)malloc(100*(sizeof(int)));ptr++;free(ptr);
-
-
-
-
-
-
-
-
-
-
-
strcat(buf,buf);
printf(buf);
}
While executing this in VC++ I do not get an output . Looks like the program runs into an infinite loop. But while executing the same in Turbo C I get the output as "hellohelloh". What could be the reason behind this difference in output?">Consider the following program segment :#include #include void main () { char buf[100] = "hello"; strcat(buf,buf); printf(buf);}While executing this in VC++ I do not get an output . Looks like the program runs into an infinite loop. But while executing the same in Turbo C I get the output as "hellohelloh". What could be the reason behind this difference in output?
-
-
-
-
-
-
}
">main(){ int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p}
A) Compile errorB) 1.00000C) Runtime error.D) 0.00000Explanation: Error because i/(*p) is 25/25 i.e 1 which is int & printed as a float, so abnormal program termination, runs if (float) i/(*p) -----> Type Casting.
-
-
-
-
-
WIPRO Technical Interview
main() { int a[]={0 1 2 3}; int *b; b=&a[2]; printf("%d",b[-1]); } TECHNICAL INTERVIEW
-
-
-
What is static memory allocation and dynamic memory allocation?
Static memory allocation: The compiler allocates the required memory space for a declared variable.By using the address of operator,the reserved address is obtained and this address may be assigned to a pointer variable.Since most of the declared variable have static memory,this way of assigning pointer value to a pointer variable is known as static memory allocation. memory is assigned during...
-
Array is an lvalue or not?
An lvalue was defined as an expression to which a value can be assigned. Is an array an expression to which we can assign a value? The answer to this question is no, because an array is composed of several separate array elements that cannot be treated as a whole for assignment purposes. The following statement is therefore illegal: int x[5], y[5]; x = y; Additionally, you might want to copy the whole...