Posts

Fibonacci series using recursive function

Write a program using recursive to read positive number  and determine the fibonacci series of n terms C Program source code#include<stdio.h> #include<conio.h> int fibbo(int n1, int n2); int n ,no=1 ,temp; int main () { int n1=0,n2=1; printf("Enter number of terms in fibbonaccic series:"); scanf("%d",&n); printf("\n"); printf("fibbonaccic series of %d term are :\n" , n); printf("%d\t",n1); printf("%d\t",n2); fibbo(n1,n2); getch(); return 0 ; } int fibbo(int n1 , int n2) { if(no==n-1) return 0; temp = n1; n1=n2; n2 =n1+ temp; printf("%d\t",n2); no++; fibbo(n1,n2); }
You can Browse related article below for more information and program code related to string function

 Does above is helpful , Post you views in comment
DO NOT MISS OTHER C PROGRAMMING TUTORIAL* indicates required Email Address *

Fibonacci series using recursive function

Multidimensional array in c

A multinational company has hired 3 sales persons for marketing/selling its 3 different products in Kathmandu .Each sales person sells each of these products. Write a c program to read number of each product sold by all sales-persons. Calculate total sells of each item and the total sells of each sales-person . Use array C Program source code#include <stdio.h> #include <conio.h> #include <string.h> int main() { int pro[3][3],sum=0; int j ,i ; char per[3][10]={ "first","second","third"}; for (i=0 ; i<3 ; i++) { for(j=0 ; j<3 ; j++) { printf("enter number of selling of %s person %s product:" , per[i] ,per[j] ); scanf("%d", &pro[i][j]); printf("\n"); } } for (i=0 ; i<3 ; i++) { for(j=0 ; j<3 ; j++) { sum = sum + pro[j][i]; } printf("Total sell of %s item is:%d\n",per[i], sum); sum=0; } for (i=0 ; i<3 ; i++) { …

Print pattern in c - star pattern-5

Image
Print pattern in c - star pattern
Write a program to print following pattern * ** *** **** Program code#include<stdio.h>int main(){int rows,i,j,space; printf("Enter number of rows: "); scanf("%d",&rows);for(i=rows;i>=1;--i){for(space=0;space<rows-i;++space) printf(" ");for(j=i;j<=2*i-1;++j) printf("* ");for(j=0;j<i-1;++j) printf("* "); printf("\n");}return0;}
You can Browse related article below for more information and program code related to recursive function call

 Does above is helpful , Post you views in comment
DO NOT MISS OTHER C PROGRAMMING TUTORIAL* indicates required Email Address *





C program source code to print reversed string using string function

C program source code to print reversed string using string function
Write a C program  to print reversed string using string function C Program source code#include<stdio.h> #include<conio.h> #include<string.h> int main() { char name[100]; printf("Enter any character:"); gets(name); strrev(name); printf("The character after reversing is:"); puts(name); getch(); return 0; }
You can Browse related article below for more information and program code related to string function

 Does above is helpful , Post you views in comment
DO NOT MISS OTHER C PROGRAMMING TUTORIAL* indicates required Email Address *


C program source code to print string length using strlen

C program source code to print string length using strlen
Write a C program  to print  string length using strlen C Program source code#include<stdio.h> #include<conio.h> #include<string.h> int main() { char name[100]; printf("Enter the character:"); gets(name); int k; k=strlen(name); printf("The length of the string is:%d",k); getch(); return 0; }
You can Browse related article below for more information and program code related to string function

 Does above is helpful , Post you views in comment
DO NOT MISS OTHER C PROGRAMMING TUTORIAL* indicates required Email Address *


C program source code to print reversed string

C program source code to print reversed string
Write a C program  to print reversed string C Program source code#include<stdio.h> #include<string.h> #include<conio.h> int main() { char a[100]; int i,n; printf("Enter any word:\n"); gets(a); n=strlen(a); printf("The reversed array is:\n" ); for(i=n-1; i>=0; i--) printf("%c",a[i]); getch(); return 0; }
You can Browse related article below for more information and program code related to recursive function call

 Does above is helpful , Post you views in comment
DO NOT MISS OTHER C PROGRAMMING TUTORIAL* indicates required Email Address *


C program source code to create file in file handling

C program source code to create file in file handling
Write a C program  to create file in file handling C Program source code#include<stdio.h> #include<conio.h> int main() { FILE *fptr; fptr=fopen("Test.txt","w"); if(fptr==NULL) { printf("\nFile can not be opened"); } else { printf("File is succesfully created"); } fputs("welcome to c programming",fptr); fclose(fptr); getch(); return 0; }
You can Browse related article below for more information and program code related to recursive function call

 Does above is helpful , Post you views in comment
DO NOT MISS OTHER C PROGRAMMING TUTORIAL* indicates required Email Address *