Showing posts with label Codes Only. Show all posts
Showing posts with label Codes Only. Show all posts

টেস্ট

Codes Only:

1. Hello World

2. Summation of two variable
2.14 Relation between two variable
2.16 Relation between two variable using char assign

3.1 Positive or Negative
3.2 Positive Negative And Zero
3.8 Even or Odd
3.10 Upper and Lower Case
3.12 OR operator use
3.13 Vowel or Consunent

Programming A B C

1. প্রথম প্রোগ্রাম "Hello World"
2. দুটি সংখ্যা যোগ করার প্রোগ্রাম

3.13 Vowel or Consunent

#include <stdio.h>
int main()
{
    char ch;
    printf("enter the character:" );
    scanf("%c", &ch);

    if (ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u'||ch=='A'||ch=='E'||ch=='I'||ch=='O'||ch=='U') //ekhane || hocche othoba er operator
    {
    printf("the %c is vowel\n\n\n",ch);
    }
    else {
        printf("%c is an consunant\n \n", ch);
    }
    return 0;
}






3.12 OR operator use

#include <stdio.h>
int main()
{
    int n;
    printf("enter the number :" );
    scanf("%d", &n);

    if (n>=5 || n<=2) //ekhane && hocche ebong er operator

    {
    printf("yes\n");
    }
    else {
        printf("No\n\n");
    }
    return 0;
}


3.10 Upper and Lower Case

#include <stdio.h>
int main()
{
    char ch;
    printf("enter the character:" );
    scanf("%c", &ch);

    if (ch>='a' && ch<='z') //ekhane && hocche ebong er operator

    {
    printf("the %c is lower case\n\n\n",ch);
    }
    else if (ch>='A' && ch<='Z') {
    printf("the %c is upper case\n\n\n",ch);
    }
    else {
        printf("%c is not an english charracter\n \n", ch);
    }
    return 0;
}



3.8 Even or Odd

#include <stdio.h>
int main()
{
    int n, remainder;
    printf("enter the number:" );
    scanf("%d", &n);
    remainder =  n % 2; // ekhane % sign ta vagshesh nirnoye bebohar kora hoy
    if (remainder==0) {
    printf("the number is even\n\n\n");
    }
    else {
    printf("the number is odd\n\n\n");
    }
    return 0;
}





3.2 Positive Negative And Zero

#include <stdio.h>
int main()
{
    int n;
    printf("enter the number:" );
    scanf("%d", &n);
    if (n>0) {
    printf("the number is positive\n\n\n");
    }
    else if (n<0) {
    printf("the number is negative\n\n\n");
    }
    else if (n==0) // ekhane else if use na krleo cole,karon proton duita condition na manlei third ta hobe
    {
    printf("the number is Zero\n\n\n");
    }
    return 0;
}





3.1 Positive or Negative

#include <stdio.h>
int main()
{
    int n;
    printf("enter the number:" );
    scanf("%d", &n);
    if (n>=0) {
    printf("the number is positive\n\n\n");
    }
    else {
    printf("the number is negative\n\n\n");
    }
    return 0;
}




2.16 Relation between two variable using char assign

#include <stdio.h>
int main()
{
    // test programme - char assign
    printf("\n Hell0 friends\n i am musab \n its my first work on char assign \n hope u will like this \n\n ");
    /* its my first work on char assign
    hope u will like this
    Note: its a multi line comment*/
    float num1, num2;
    double val;
    char ch;
    printf("enter the first number : ");
    scanf("%f",&num1);
    printf("enter another number : ");
    scanf("%f",&num2);
    ch='+';
    val=num1+num2;
    printf("%0.2f %c %0.2f=  %0.2lf\n",num1,ch,num2, val);
    ch='-';
    val=num1-num2;
    printf("%0.2f %c %0.2f= %0.2lf\n",num1,ch,num2, val);
    ch='*';
    val=num1*num2;
    printf("%0.2f %c %0.2f=  %0.2lf\n",num1,ch,num2, val);
    ch='/';
    val=num1/num2;
    printf("%0.2f %c %0.2f=  %0.2lf\n",num1,ch,num2, val);

    return 0;
}


2.14 Relation between two variable

#include <stdio.h>
int main()
{
    float num1, num2;
    double val;
    char ch;
    printf("enter the first number : ");
    scanf("%f",&num1);
    printf("enter another number : ");
    scanf("%f",&num2);
    ch='+';
    val=num1+num2;
    printf("%0.2f %c %0.2f=  %0.2lf\n",num1,ch,num2, val);
    ch='-';
    val=num1-num2;
    printf("%0.2f %c %0.2f= %0.2lf\n",num1,ch,num2, val);
    ch='*';
    val=num1*num2;
    printf("%0.2f %c %0.2f=  %0.2lf\n",num1,ch,num2, val);
    ch='/';
    val=num1/num2;
    printf("%0.2f %c %0.2f=  %0.2lf\n",num1,ch,num2, val);

    return 0;
}




2. Summation of two variable

 #include <stdio.h> int main() { int a , b, sum; Printf("enter the value of a :"); scanf("%d%", &a; Printf("enter the value of b :"); scanf("%d%", &b; sum = a + b; printf("Sum is %d", sum); return 0; }

1. Hello World


#include <stdio.h>
int main ()

{
    printf("Hello World");
  
    return 0;
}