Posts

Showing posts with the label Syllabus

Modular operator in c ( Chapter 1 Program 9)

Image
Also visit our YouTube Channel Tech Eos     VISIT CHANNEL /*  9. Write a program to enter a number and carry out modular division operation by 2, 3 and 4 and display the remainders */ #include<stdio.h> #include<conio.h> void main() { int number ; clrscr(); printf("Enter an number : "); scanf("%d" , &number); printf("\nModular Division 2 of %d is %d" , number , number%2); printf("\nModular Division 3 of %d is %d" , number , number%3); printf("\nModular Division 4 of %d is %d" , number , number%4); getch(); }  

Decimal to octal and hexadecimal ( Chapter 1 Program 6

Image
Also visit our YouTube Channel Tech Eos     VISIT CHANNEL /*    6. Write a program to accept an integer and display it  in octal and hexadecimal formats               */ #include<stdio.h> #include<conio.h> void main() { int number; clrscr(); printf("\nEnter an number : "); scanf("%d" , &number); printf("\n\nDecimal format is     %d" , number); printf("\nOctal format is       %o" , number); printf("\nHexadecimal format is %x" , number); getch(); }

Swapping Two Numbers Program in C (Chapter 1 Program 5)

Image
Also visit our YouTube Channel Tech Eos     VISIT CHANNEL /* 5. Write a program to store and interchange two numbers in variables a and b. */ #include<stdio.h> #include<conio.h> void main() { int a , b , c ; clrscr(); printf("\nEnter value of a : "); scanf("%d" , &a); printf("\nEnter value of b : "); scanf("%d" , &b); printf("\n\nBefore Swapping\n\n"); printf("\na = %d" , a); printf("\nb = %d" , b); //  Logic c = a; a = b; b = c; printf("\n\nAfter Swapping\n\n"); printf("\na = %d" , a); printf("\nb = %d" , b); getch(); }

Convert Fahrenheit to Celsius (Chapter 1 Program 4)

Image
Also visit our YouTube Channel Tech Eos     VISIT CHANNEL /* 4. Write a program to enter the temperature in Fahrenheit    and convert it to Celsius.[C = ((F-32)*5)/9]  */ #include<stdio.h> #include<conio.h> void main() { float fahrenheit , celsius ; clrscr(); printf("\nEnter temperature in fahrenheit : "); scanf("%f" , &fahrenheit); celsius = ( ( fahrenheit - 32 )*5 )/9 ; printf("\n\nAfter conversion Celsius = %f " , celsius); getch(); }

Square and Cube of the Numbers (Chapter 1 Program 3)

Image
Also visit our YouTube Channel Tech Eos     VISIT CHANNEL /* 3. Accept any three numbers and find their squares and cubes.  */ #include<stdio.h> #include<conio.h> void main() { int number1 , number2 , number3 ; clrscr(); printf("\nEnter 1 number value  :  "); scanf("%d" , &number1); printf("\nEnter 2 number value  :  "); scanf("%d" , &number2); printf("\nEnter 3 number value  :  "); scanf("%d" , &number3); //  SQUARES OF THE NUMBERS printf("\n\nSquare of number 1 is %d", (number1*number1)  ); printf("\nSquare of number 2 is %d" , (number2*number2) ); printf("\nSquare of number 3 is %d" , (number3*number3) ); // CUBES OF THE NUMBERS printf("\n\nCube of number 1 is %d" , (number1*number1*number1) ); printf("\nCube of number 2 is %d ", (numb...

Chapter 1 Program 2

Image
Also visit our YouTube Channel Tech Eos     VISIT CHANNEL /*      2. Find the area and perimeter of square and rectangle. Input the side(s) through the keyboard.      */ #include<stdio.h> #include<conio.h> void main() { int a , area_of_square , perimeter_of_square ;   //FOR Square         // FOR Rectangle int length , width , area_of_rectangle , perimeter_of_rectangle;   clrscr(); printf("\nEnter value of a : "); scanf("%d" , &a); // area of square formula -->>   (a*a) area_of_square = (a*a); //perimeter of square formula -->> (4*a) perimeter_of_square = (4*a); printf("\n\nArea of Square    :  %d " , area_of_square ); printf("\nPerimeter of Square :  %d " ,                     ...

Chapter -1 Program -1

Image
Also visit our YouTube Channel Tech Eos    VISIT CHANNEL /* 1 . Find the Simple Interest. Inputs are principal amount,    period in year and rate of interest.    */ void main() { float principal_amount , rate_of_interest ; int peroid_in_year; float simple_interest ; clrscr(); printf("\nEnter principal amount : "); scanf("%f" , &principal_amount); printf("\nEnter rate of interest : "); scanf("%f" , &rate_of_interest); printf("\nEnter peroid of year   : "); scanf("%d" , &peroid_in_year); //    Simple Interest Fromula     (p*r*n)/100 simple_interest = ( principal_amount * rate_of_interest * peroid_in_year )/100; printf("\n\nSimple Interest is  %f " , simple_interest ); getch(); }