Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entry Challenge V2 #2

Open
Devabubakar opened this issue Feb 15, 2022 · 2 comments
Open

Entry Challenge V2 #2

Devabubakar opened this issue Feb 15, 2022 · 2 comments

Comments

@Devabubakar
Copy link
Collaborator

Entry Challenge V2

// Write a function that takes a value as argument
// Return the type of the value

| Function              | Expected Value    |
|-----------------------|-------------------|
| myFunction(1)         | Expected'number'  |
| myFunction(false)     | Expected'boolean' |
| myFunction({})        | Expected 'object' |
| myFunction(null)      | Expected 'object' |
| myFunction('string')  | Expected 'string' |
| myFunction(['array']) | Expected 'object' |
@kdali9
Copy link

kdali9 commented May 7, 2022

BTS

@kdali9
Copy link

kdali9 commented May 7, 2022

#include <stdio.h>
#include <string.h>
int function(int, int[]);

int main()
{
int i, a = 20;
int arr[5] = { 10, 20, 30, 40, 50 };
a = function(a, &arr[0]);
printf("value of a is %d\n", a);
for (i = 0; i < 5; i++) {
printf("value of arr[%d] is %d\n", i, arr[i]);
}
return 0;
}

int function(int a, int* arr)
{
int i;
a = a + 20;
arr[0] = arr[0] + 50;
arr[1] = arr[1] + 50;
arr[2] = arr[2] + 50;
arr[3] = arr[3] + 50;
arr[4] = arr[4] + 50;
return a;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants