Q1. Code For Fibonaaci Series
Q1. Code For Fibonaaci Series
#include <stdio.h>
n = atol(argv[1]);
if ( c <= 1 )
next = c;
else
first = second;
second = next;
printf("%d\n",next);
return 0;
int c[10];
int i,temp,j,greatest;
j = 0;
temp = atoi(argv[i]);
c[j] = temp;
j++;
greatest = c[0];
greatest = c[i];
return 0;
Q3. Code of n!
#include <stdio.h>
int n,i;
n = atol(argv[1]);
factorial *= i;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int k;
char temp;
int i,j=0;
int strsize = 0;
for (i=1; i<argc; i++) {
strsize += strlen(argv[i]);
strsize++;
char *cmdstring;
cmdstring = malloc(strsize);
cmdstring[0] = '\0';
strcat(cmdstring, argv[k]);
i = 0;
j = strlen(cmdstring) - 1;
while (i < j) {
temp = cmdstring[i];
cmdstring[i] = cmdstring[j];
cmdstring[j] = temp;
i++;
j--;
}
printf("\nReverse string is :%s", cmdstring);
return(0);
#include <stdio.h>
firstNumber = atol(argv[1]);
secondNumber = atol(argv[2]);
temporaryVariable = firstNumber;
firstNumber = secondNumber;
secondNumber = temporaryVariable;
return 0;