#include stdio.h /*www.nabilphysics.blogspot.com*/
void main() /*reminder operation*/
{
int p=1;
while(p<100)
{
if(p%5==0)
printf("%d\n",p);
p++;
}
}
#include stdio.h //2007132023,Syed Razwanul Haque Nabil,SUST,PHYSICS
void main() //prime number determination
{
int p=2,n,flag=1;
scanf("%d",&n);
while(p
{
if(n%p==0)
{
flag=0;
break;
}
}
if(flag==1)
printf("Prime");
else
printf("Not Prime");
}
#include stdio.h /* use of switch statement*/
void main() /*www.nabilphysics.blogspot.com*/
{
do
{
printf("\t\tSome Information of Bangladesh\n");
printf("Please enter your choice:\n");
printf("1 for DHAKA\n2 for Chittagonj\n3 for Rajshai\n4 for Khulna\n5 for Sylhet\n6 for Barishal\n7 for Rangpur\n\n\a");
int a;
scanf("%d",&a);
printf("Basic information about: ");
switch(a)
{
case 1:
printf("Dhaka\n\n\a");
printf("Population:3,86,77,876\n\n");
printf("Education:42.6%\n\n");
printf("Sector:2,3,11\n\n");
printf("Village:25435\n");
break;
case 2:
printf("Chittagonj:\n\n\a");
printf("Population:2,39,99,345\n\n");
printf("Education:41.1%\n\n");
printf("Sector:1,2\n\n");
printf("Village:15037\n");
break;
case 3:
printf("Rajshai\n\n\a");
printf("Population:2,99,92,955\n\n");
printf("Education:40.9%\n\n");
printf("Sector:7,6\n\n");
printf("Village:23639\n");
break;
case 4:
printf("Khulna\n\n\a");
printf("Population:1,44,68,819\n\n");
printf("Education:46.2%\n\n");
printf("Sector:9\n\n");
printf("Village:9284\n\a");
break;
case 5:
printf("Sylhet\n\n\a");
printf("Population:78,99,816\n\n");
printf("Education:39.2%\n\n");
printf("Sector:3,4,5\n\n");
break;
case 6:
printf("Barishal\n\n\a");
printf("Population:81,12,435\n\n");
printf("Education:58.6%\n\n");
printf("Sector:8\n\n");
printf("Village:4193\n");
break;
case 7:
printf("Rangpur\n\n\a");
printf("Population:Not yet Collected\n\n");
printf("Education:Not yet collected\n\n");
printf("Sector:Not yet collected\n\n");
break;
}
}
while(1);
}
#include stdio.h //maximum value from 4 value using function
test(int x,int y); //www.nabilphysics.blogspot.com
void main()
{
int a,b,c,d,e,q;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&e);
d=test(a,b);
q=test(c,e);
printf("%d",test(d,q));
}
test(int x,int y)
{
int z;
z=(x>=y)?x:y;
return(z);
}
#include stdio.h //lower case to uppercase conversion
#include ctype.h //www.nabilphysics.blogspot.com
void main()
{
int lower,upper;
lower=getchar();
upper=toupper(lower);
putchar(upper);
return(lower);
}
#include stdio.h //LAB problem,if d lower then 50 print 60 to 1
void main() // if d greater then 50 print 1 to 40
{ //www.nabilphysics.blogspot.com
int d,p;
scanf("%d",&d);
if(d>50)
{
p=60;
while(p>0)
{
printf("%d\n",p);
p--;
}
}
else
{
int x=1;
while(x<=40)
{
printf("%d\n",x);
x++;
}
}
}
#include stdio.h //Syed Razwanul Haque Nabil,SUST,PHYSICS
main() //2007132023,grading system
{
do
{
int x;
printf("Programme to calculate the grading of a student\n");
printf("Please Enter Your number to find out Grade: ");
scanf("%d",&x);
if(x>=80)
printf("A+\n\n");
if(79>=x)
printf("A\n\n");
if(69>=x)
printf("A-\n\n");
if(59>=x)
printf("B+\n\n");
if(59>=x)
printf("B\n\n");
if(49>=x)
printf("C\n\n");
if(39>=x)
printf("C-");
if(33>x)
printf("Fail");
}
while(1);
}
#include stdio.h //calculation of total CGPA
void main() //www.nabilphysics.blogspot.com
{
float cs1,ob1,to1,cs2,ob2,to2,cs3,ob3,to3,grand; //all variable decleration
printf("credit of subject 1= ");
scanf("%f",&cs1);
printf("credit you obtained subject 1= ");
scanf("%f",&ob1);
printf("credit of subject 2= ");
scanf("%f",&cs2);
printf("credit you obtained subject 2= ");
scanf("%f",&ob2);
printf("credit of subject 3= ");
scanf("%f",&cs3);
printf("credit you obtained subject 3= ");
scanf("%f",&ob3);
//credit of subject*credit obtained=Total
to1=cs1*ob1;
to2=cs2*ob2;
to3=cs3*ob3;
printf("Point of Subject 1= ");
printf("%f",to1);
printf("\n\nPoint of Subject 2= ");
printf("%f",to2);
printf("\nPoint of Subject 3= ");
printf("%f",to3);
printf("\nAverage Point= ");
grand=(to1+to2+to3)/(cs1+cs2+cs3);
printf("%f",grand);
}
//Grand=(to+to)/(cs+cs)
#include stdio.h //for Basic Understanding
#include math.h //syed razwanul haque nabil,phy,SUST
#include string.h
void main()
{
do
{
float a;
scanf("%f",&a);
printf("ceil:%f\n",ceil(a));
printf("floor:%f\n",floor(a));
printf("power:(5,2)%f\n",pow(5,2));
printf("sin:%f\n",sin(60));
printf("sqrt:9>>\t%f\n\n",sqrt(9));
printf("strlen:%d",strlen("hello\0"));
}
while(1);
}
//factorial calculation
#include stdio.h
void main()
{
int n,p=1;
scanf("%d",&n);
while(n>0)
{
p=p*n;
p--;
)
printf("%d",p);
}