Tags » C Program

Dynamic 2-D (two dimensional) char array

#include<stdio.h>

#define Y_AXIS 4
#define X_AXIS 10

/***********************************
2-D char array dynamically

arr[0]->victor
arr[1]->simon
arr[2]->will
arr[4]->lee

**********************************/
int main() {

char **arr;
int i;

arr = (char**)malloc(sizeof(arr) * Y_AXIS); 50 more words

C Program

C programs for recurssion (fibonacci, factorial & GCD)

// fibonacci

# include<stdio.h>
void fib(int n, int a, int b)
{
int c;
c = a + b;
printf(” %d,”,a);
if(n!=1) 135 more words

1st Semester

C program to find the sin(x)value & cos(x)value using series expansion, where x is in radiance.

(Hint: Sin(x) = x – x^3 / 3! + x^5 / 5! – …….)
(Hint: Cos (x)= 1 – x^2 / 2! + x^4 / 4!……) 141 more words
1st Semester

C program to generate first n terms of the fibonacci series.

# include <stdio.h>

void main()
{
int a = 0 ,b = 1, c, n;
printf(“Enter the count to which you want fibonacci series to print : “); 22 more words

1st Semester

C program to find max, min and sum of given set of numbers.

# include <stdio.h>

void main()
{
int max , min , sum , num, count;
printf(“Enter the count of numbers you want to enter : “); 53 more words

1st Semester

C program which takes two integer operands & one operator from the user, performs the operation and then prints the result.

(Note : operators are +, -, *, / and % and use the switch case)

# include <stdio.h>

void main()
{
int a, b;
char choice; 95 more words

1st Semester

C program to find the roots of a quadratic equation.

# include <stdio.h>
# include <math.h>

void main ()
{
double a, b, c, root;
printf(“Enter values for a : “);
scanf(“%lf”,&a);
printf(“\t b : “); 51 more words

1st Semester