void main()
{
char a[]="12345\0";
int i=strlen(a);
printf("here in 3 %d\n",++i);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
here in 3 6
Explanation:
The char array 'a' will hold the initialized string, whose
length will be counted from 0 till the null character. Hence
the 'I' will hold the value equal to 5, after the
pre-increment in the printf statement, the 6 will be printed.
| Is This Answer Correct ? | 18 Yes | 4 No |
Answer / ravneet kaur
as this is a character array and would have string in double
quotes so this code shows an error i.e. *char wont changes
to *int.
| Is This Answer Correct ? | 0 Yes | 5 No |
program to find the roots of a quadratic equation
14 Answers College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,
find A^B using Recursive function
void func1(int (*a)[10]) { printf("Ok it works"); } void func2(int a[][10]) { printf("Will this work?"); } main() { int a[10][10]; func1(a); func2(a); } a. Ok it works b. Will this work? c. Ok it worksWill this work? d. None of the above
void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }
how to swap 3 nos without using temporary variable
main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }
Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }
1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.
There is a lucky draw held every day. if there is a winning number eg 1876,then all possible numbers like 1867,1687,1768 etc are the numbers that match irrespective of the position of the digit. Thus all these numbers qualify fr the lucky draw prize Assume there is no zero digit in any numbers. write a program to show all the possible winning numbers if a "winning number"is passed as an arguments to the function.
main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }
int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }