Easy Coding
13/11/2021
void main() { int num1 , num2 , temp1 , temp2 , rem1 , rem2 , sum=0; printf ( "\nEnter 1st Number : " ); scanf ( "%d" , &num1 ); printf ( "\nEnter 2nd Number : " ); scanf ( "%d" , &num2 ); temp1 = num1; while ( temp1 > 0 ) { rem1 = temp1 % 10; …...
Write a program that reads two numbers and finds the sum of the product of digits of the number.If Numbers are 224 and 37 then the Answer is23+27+23+27+43+47=80 void main() { int num1 , num2 , temp1 , temp2 , rem1 , rem2 , sum=0; printf ( “ Enter 1st Number : ” ); scanf ( “%d” , &num1 ); printf ( “…
27/09/2021
#!/bin/bash add(){echo $(( $1 + $2 ))} subtract(){echo $(( $1 - $2 ))} multiply(){echo $(( $1 * $2 ))} divide(){echo $(( $1 / $2 ))} mod(){echo $(( $1 % $2 ))} while true;do echo "What do you want?"echo "1. Addition"echo "2. Subtraction"...
Write a shell script to implement the menu driven calculator using function and case. #!/bin/bash add(){echo $(( $1 + $2 ))} subtract(){echo $(( $1 – $2 ))} multiply(){echo $(( $1 * $2 ))} divide(){echo $(( $1 / $2 ))} mod(){echo $(( $1 % $2 ))} while true;do echo “What …
25/09/2021
read –p “Enter first number : ” num1 read –p “Enter second number : ” num2 echo “$num1 + $num2 = $(( num1 + num2 ))” Output: Enter first number : 5 Enter second number : 6 5 + 6 = 11
Write a script which take input from user and calculate the addition read –p “Enter first number : ” num1 read –p “Enter second number : ” num2 echo “$num1 + $num2 = $(( num1 + num2 ))” Output: Enter first number : 5 Enter second number : 6 5 + 6 = 11…
14/09/2021
void main() { char ch; printf ( "\nEnter a 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') …...
Write a C program to find out given character is vowel or not. void main() { char ch; printf ( “ Enter a character : ” ); scanf ( “%c” , &ch ); if ( ch == ‘A’ || ch == ‘E’ || ch == & #…
13/09/2021
void main() { int num; printf ( "\nEnter a Number : " ); scanf ( "%d" , &num ); switch ( num > 0 ) { case 1: printf ( "\n%d is a positive number." , num ); break; case 0: switch ( num < 0 ) { case 1: printf ( "\n%d is a negative number." , num ); …...
Check whether a number is positive, negative or zero using a switch statement. void main() { int num; printf ( “ Enter a Number : ” ); scanf ( “%d” , &num ); switch ( num > 0 ) { case 1: printf ( “ %d is a positiv…
28/08/2021
void main() { int ch=0, num1, num2; //to store the numbers and their result clrscr(); //to clear the output screen printf ( "\nEnter the 1st number : "); scanf ( "%d" , &num1 ); printf ( "\nEnter the 2nd number : "); scanf ( "%d" , &num2 ); printf ( "\nWhat do you want to do?" ); printf ( "\n1.Addition 2.Subtraction" );...
Example of conditional statement (switch..case) void main() { int ch=0, num1, num2; //to store the numbers and their result clrscr(); //to clear the output screen printf ( “ Enter the 1st nu…
Click here to claim your Sponsored Listing.
Category
Contact the school
Address
City Chowk
Patna
800008