Please can you tell me the answer for the following test case?
5 9 1 2
6 8 1 2
7 6 1 2
8 4 1 2
Type: Posts; User: aakashjohari
Please can you tell me the answer for the following test case?
5 9 1 2
6 8 1 2
7 6 1 2
8 4 1 2
Hi All,
I have written the following code.
#include <stdio.h>
#include <stdlib.h>
int main()
{
Yes, you are right cas. It is machine dependent.
Yes, You all are right.
I have experimented this.
C maintains a stack for arguments.
printf ("%c %c", 'A', 'B');
In this case, 'A' is first pop-out and then 'B'. (A character is 8-bit...
It is not the case that the program is not compiled correctly.
printf() is returning 11.
and I have compiled it with -lm switch. So no chance of not being compiled correctly.
Hoping for the...
I know well. That I must you %d instead of %f for this. But the question is that why it is affecting the second correctly specified ceil() function value
Hi all,
Please go through the following very basic code.
#include <stdio.h>
#include <math.h>
int main()
{
I think this may help you out. This gives the the approximate time (more than the observed running time by "time" command in linux).
#include <stdio.h>
#include <time.h>
int main()
{
...
Convert the user's answer string into lower case. And have your capital list also in lower case(as you have already had in capital array). Now you easily can compare both strings by strcmp() function.
I can answer you for your second question.
In C, any non-zero integer is considered as true and zero as false. So In the following for loop suppose e has initial value as 5. Then as 5 is non-zero...
This may help you out.
#include <stdlib.h>
#include <stdio.h>
void func(int **data)
{
*data = (int *)malloc(2 * sizeof(int));
But please go through this link.
It says that memory allocation goes contiguous even for the statically defined variables.
How Stuff Works
Thanks and Best Regards,
Aakash Johari
It is very easy to add it for thousand times. Your current code is perfect for a single interation. What you will have to do is just to enclose it within a loop that runs for 1000 times.
You must...
Hello All,
I have written the following code. I have declared 2 arrays t and s both of size of 4 integers and two integer variables u and i. Please pay attention to the order they...
Sorry, I couldnt get you. :(
Thank you very much.
I got it. :)
In which way, it becomes invalid. Its still pointing to the same address. And after running the whole code, I found the output:
0 20 30
Means, it just cleared out the first integer space and...
Hello,
I was doing some experiments with pointer and wrote the following code :-
#include <stdio.h>
#include <stdlib.h>
int main()
{
int *p;