CBSE Class 10 Computer Science C program to illustrate use of function with argument and return value
//program to illustrate use of function with argument and return value #include int sqr(int); //function declaration void main() { int number, result; printf("\n Enter your number = "); scanf("%d", &number); result=sqr(number); //function call printf("\n the square of %d is %d…
CBSE Class 10 Computer Science C program to illustrate use of function with argument and no return value
//program to illustrate use of function with argument and no return value #include void cube(int); //function declaration void main() { int number; printf("Enter your number = "); scanf("%d", &number); cube(number); //function call } void cube (int num1) //function definition {…
CBSE Class 10 Computer Science C program to illustrate use of function which return no value
//program to illustrate use of function which return no value #include void print_line(); //function declaration void main() { print_line(); //function call printf("Welcome to the world of C function……"); print_line(); //function call } void print_line() //function definition {…
CBSE Class 10 Computer Science C program of addition(function with return type and with arguments)
//program of addition(function with return type and with arguments) #include #include void main() { int n1,n2,res; int add(int,int); //function declaration clrscr(); printf("\n Enter number 1 = "); scanf("%d", &n1); printf("\n Enter number 2 = "); scanf("%d", &n2); res=add(n1,n2…
CBSE Class 10 Computer Science C program to print table of given number
//program to print table of given number #include #include void main() { int i,no; clrscr(); printf("\n Enter number for table = "); scanf("%d", &no); for(i=1;i
CBSE Class 10 Computer Science C program to print odd numbers between given numbers
//program to print odd numbers between given numbers #include #include void main() { int n1,n2,i; clrscr(); printf("\n Enter number 1 = "); scanf("%d", &n1); printf("\n Enter number 2 = "); scanf("%d", &n2); for(i=n1;i
CBSE Class 10 Computer Science C program to print series using do-while loop
to print series using do-while loop #include #include void main() { int n1,n2,i; clrscr(); printf("\n Enter number 1 = "); scanf("%d", &n1); printf("\n Enter number 2 = "); scanf("%d", &n2); i=n1; do { printf("\n %d", i); i++; }while(i
CBSE Class 10 Computer Science C program to print series using while loop
//program to print series using while loop #include #include void main() { int n1,n2,i; clrscr(); printf("\n Enter number 1 = "); scanf("%d",&n1); printf("\n Enter number 2 = "); scanf("%d",&n2); i=n1; while(i
CBSE Class 10 Computer Science C program to print series using for loop
program to print series using for loop #include #include void main() { int n1,n2,i; clrscr(); printf("\n Enter number 1 = "); scanf("%d", &n1); printf("\n Enter number 2 = "); scanf("%d", &n2); for(i=n1;i
CBSE Class 10 Computer Science C program of array for theory only
//program of array for theory only (THIS PROGRAM IS ONLY FOR THEORY) #include #include void main() { int mark[5],i; clrscr(); printf("\n Enter values... of array"); for(i=0;i
CBSE Class 10 Computer Science C program for Addition Subtraction and Division using Else If ladder
//PROGRAM FOR ADDITION, SUBTRACTION AND DIVISION USING ELSE-IF LADDER #include #include void main() { float n1,n2,result; int choice; clrscr(); printf("\n 1. Addition \n 2. Subtraction \n 3. Multiplication "); printf("\n Enter your choice = "); scanf("%d", &choice); printf("\n…
CBSE Class 10 Computer Science C program to find addition subtraction and multiplication using switch
PROGRAM TO FIND ADDITION, SUBTRACTION AND MULTIPLICATION USING SWITCH #include #include void main() { float n1,n2,result; int choice; clrscr(); printf("\n 1. Addition \n 2. Subtraction \n 3. Multiplication "); printf("\n Enter your choice = "); scanf("%d",&choice); printf("\n…
CBSE Class 10 Computer Science C program to find person is eligible for voting or not
//PROGRAM TO FIND PERSON IS ELIGIBLE FOR VOTING OR NOT #include #include void main() { int age; clrscr(); printf("\n Enter your age = "); scanf("%d", &age); if(age>=18) printf("\n U R eligible for voting"); else printf("\n U R not eligible for voting"); getch(); }
CBSE Class 10 Computer Science C program to find student is pass or fail
//PROGRAM TO FIND STUDENT IS PASS OR FAIL #include #include void main() { float maths,sci,eng,guj,comp; clrscr(); printf("\n Enter mark of maths = "); scanf("%f", &maths); printf("\n Enter mark of sci = "); scanf("%f", &sci); printf("\n Enter mark of eng = "); scanf("%f",…
CBSE Class 10 Computer Science C program to find whether a given no is divisible by another number or not
//PROGRAM TO FIND WHETHER A GIVEN NO IS DIVISIBLE BY ANOTHER NUMBER OR NOT #include #include void main() { int n1,n2; clrscr(); printf("\n Enter n1 = "); scanf("%d", &n1); printf("\n Enter n2 = "); scanf("%d", &n2); if(n1%n2==0) printf("\n %d is divisible by %d ", n1,n2); else…