Beruflich Dokumente
Kultur Dokumente
ON
DEPARTMENT OF ACCOUNTING & INFORMATION SYSTEMS FACULTY OF BUSINESS STUDIES UNIVERSITY OF DHAKA
Submitted to: Minhaj Ferdous Assistant teacher Department of Accounting and Information Systems.
Submitted by: The Gladiator Serial No 01 02 03 04 05 06 Name Md. Al-amin(Group Leader) Md.Akter Hossain Farhana Yasmin Md. Din Islam Moniruzzaman Md. Kowser Bhuiyan ID No 14032 14021 14024 14031 14035 14083
Table of Contents
Page No.
A program for string copying. Two strings are equal or not. Program for finding the length of a string. Program for string concatanation.
Finding power value.
#include<stdio.h> #include<conio.h>
f=1.8*c+32;
2. Factorial of a Number.
#include<stdio.h> #include<conio.h> void main() {int i,n,fact; clrscr(); printf("Enter a numbet to get factorial:"); scanf("%d",&n); if(n==0) printf("\nThe factorial is 1."); else for(i=1;i<n;i++) fact=fact*i; printf("\nThe factorial is %d,",fact); getch(); }
#include<stdio.h> #include<conio.h> #include<math.h> void main() { int i,n; float list[50],sum,avg,d,sd; clrscr(); printf("How Many Numbers"); scanf("%d",&n); sum=0; for(i=0;i<n;i++) { printf("\nEnter Number"); scanf("%f",&list[i]); sum=sum+list[i]; avg=sum/n; for(i=0;i,n;i++) d=list[i]-avg; sum=(sum+(d*d)); }
#include<stdio.h> #include<conio.h> void main() { int a; clrscr(); printf("Enter data to test"); scanf("%d",&a); if((a%4)==0) printf("\nLeap year"); else printf("\nNot Leap Year"); getch(); }
#include<stdio.h> #include<conio.h> void main() { int i,num,result; clrscr(); printf("Enter number to test"); scanf("%d",&num); result=1; for(i=2;i,num/i;i++) if((num%i)==0)result=0; if(result==1) printf("\nThe Number Is Prime"); else printf("\nThe number is Not Prime"); getch(); }
#include<stdio.h> #include<conio.h> void main() { int i,n,a[50]; clrscr(); printf("How Many Numbers?"); scanf("%d",&n); a[0]=1; a[1]=1; for(i=2;i<n;i++) a[i]=a[i-1]+a[i-2]; printf("The Series is"); for(i=0;i<n;i++) printf("%d",a[i]); getch(); }
#include<stdio.h> #include<conio.h> #include<string.h> void main() { char str1[20],str2[20]; clrscr(); printf("Enter a strig:"); scanf("%s",str1); strcpy(str2,str1); printf("The original string is:%s",str1); printf("\nAnd the copy is:%s",str2); getch(); }
#include<stdio.h> #include<conio.h> #include<string.h> void main() { char x[30],y[30]; int f; clrscr(); printf("Enter a string:"); scanf("%s",x); printf("Enter another string:"); scanf("%s",y); f=strcmp(x,y); if(f!=0) printf("\nTwo strings are not equal."); else printf("\nTwo strings are equal."); getch(); }
#include<stdio.h> #include<conio.h> #include<string.h> void main() { char str[30]; int l; clrscr(); printf("Enter a strig:"); scanf("%s",str); l=strlen(str); printf("\nThe length of the string is:%d",l); getch(); }
getch(); }
#include<stdio.h> #include<conio.h> #include<string.h> void main() { char *ch,*find,*str; clrscr(); printf("Enter a string"); scanf("%s",str); printf("Enter a chracter"); scanf("%s",ch); find=strstr(str,ch); if(find) printf("\nThe charater exists in the string"); else printf("\nThe chracter doesnot exist in the string"); getch(); }
#include<stdio.h> #include<conio.h> void main() { int num; printf(" Enter a number"); scanf("%d",&num); if((num%2)==0) printf("\n The number is even"); else printf("\n The number is odd"); getch(); }
void main() { int list[3],i,max; for(i=0; i<3; i++) { printf(" Enter the number"); scanf("%d",&list[i]); } max=list[0]; for(i=1;i<3;i++) { if(list[i]>max) max=list[i]; } printf("\n The bigger number is %d",max); getch(); }
{ int a,b,c; float d,root_1,root_2; clrscr(); printf("\n Enter values for a"); scanf("%d",&a); printf("\n Enter values for b"); scanf("%d",&b); printf("\n Enter values for c"); scanf("%d",&c); d=(b*b-4*a*c); if(d<0) printf("\n\n Roots are imaginary"); else { root_1=(-b+sqrt(d))/(2*a); root_2=(-b-sqrt(d))/(2*a); printf("\n\n x=%.4f,%.4f",root_1,root_2); } getch(); }