CCExtractor Development

Code in C: create a program using for loop

Find out number which is bigger then given provided number and have least difference with other number in list. List is shorted list

Show us the your

  1. code in comment.
  2. show output of program, by compiling your program with changing value of number.
#include <stdio.h>
int find_nearest_bigger(int num, int *list)
{
    // Write your logic here
}
int main(void)
{
     int list[10] = {12, 16, 89, 102, 103, 204, 308, 412, 867, 1000};
     // make sure your function support any number
     int number = 72;
     int answer = find_nearest_bigger(number, list);
     printf("Nearest bigger from number (%d) was %d", number, answer);
}

Related task: https://codein.withgoogle.com/dashboard/tasks/6441648058793984/ https://codein.withgoogle.com/dashboard/tasks/6508080666771456/

Task tags

  • forloop
  • function
  • c
  • compile
  • code

Students who completed this task

Horatiu, Nika, Andrej Velichkovski, super dukes, Gayathri

Task type

  • code Code

Level

Beginner
close

2018