Monday, November 1, 2021

DO-WHILE LOOP PROGRAME (C-PROGRAMING)

 #include <stdio.h>

// stdio.h means standard input and output file .header it is called as a library which store or tell compiler what type of input and output function is used such as printf(print output),scanf(take output from user) 

int main() {

    int num,index=0;//decleration + initialization//

    printf("Enter a no\n") //\n is new line escape sequence//;

    scanf("%d",&num); // %d is formate specifire and & is adress which is store variable value//

    do{        //code to be executed//

        printf("%d\n",index+5);//i+5//

        index=index+5;

    }while(index<num);//condition//

return 0;

}

#include <stdio.h>


int main() {

    int num,index=0;

    printf("Enter a no\n");

    scanf("%d",&num);

    do{

        printf("%d\n",index+5);

        index=index+5;

    }while(index<num);

return 0;

}


PROGRAME ON IF-ELSE CONTROL STATEMENT

#include <stdio.h>


int main() {

    int age;

    printf("Enter your age\n");

    scanf("%d",&age);

    printf("you have enterd %d as your age\n",age);

    if(age>18) 

    {

    printf("you can vote");

}

else if (age>10)

{

printf("you are between 10 to 18 and you can vote for babis");

}

else 

{

    printf("you can not vote");

}


return 0;

}

TO FIND VOLUME OF CUBE USING C-PROGRAMING

// Online C compiler to run C program online

#include <stdio.h>

//stdio means standerd inuput and output library it stres printf i.e output and scanf i.e input//

int main() //Decleration// 

{

    int l,b,h, volume;//initilization//

    printf("Enter the value of l\n");

    scanf("%d",&l); // in this line %d is format specifire amd &l is addres //

    printf("Enter the value of b\n");

    scanf("%d",&b);

    printf("Enter the value of h\n");

    scanf("%d",&h);

    volume = l*b*h;

    printf("volume is equal to %d",volume);

    return 0;

}

A Day in the Life of a Computer Science Student

  💻 A Day in the Life of a Computer Science Student Being a computer science student is often misunderstood. People assume we just sit ...