Mega Code Archive

 
Categories / C / Code Snippets
 

One line comments

#include <stdio.h> #include <stdlib.h> int avg(int x,int y) { return (x + y)/2; } int main() { int i, j; int answer; /* comments are done like this */ i = 9; j = 13; answer = avg(i,j); printf("The mean of %d and %d = %d\n", i, j, answer); exit (0); }