Compare two integers in C

Selection-sort-step to compare

Compare two integers in C Algorithm Let’s first see what should be the step-by-step procedure to compare two integers− START Step 1 → Take two integer variables, say A & B Step 2 → Assign values to variables Step 3 → Compare variables if A is greater than B Step 4 → If true print … Read more

C program for matrix addition

matrix program in c

C program for matrix addition #include <stdio.h> int main() { int a, b, c, d; int m1[10][10], m2[10][10], sum[10][10]; printf(“Please enter the number of rows of matrix\n”); scanf(“%d”, &a); printf(“Please enter number of columns of matrix\n”); scanf(“%d”, &b); printf(“Please enter the elements of first matrix one by one\n”); for ( c = 0 ; c … Read more

Program to Check a whether a Number is Odd or Even using Switch Case

C program to display the odd digits present in integer

Program to Check a whether a Number is Odd or Even using Switch Case #include<stdio.h> int main(){ int number,remainder; clrscr(); printf(” Enter an integer number: “); scanf(“%d”,&number); remainder = abs(number) % 2; switch(remainder){ case 0 : printf(“\n %d is an even number.”,number); break; case 1 : printf(“\n %d is an odd number.”,number); break; } getch(); … Read more

C program to display odd numbers between 1 and 100

C program to display the odd digits present in integer

C program to display odd numbers between 1 and 100 #include<stdio.h> int main(){ int rem,i; printf(“\n The odd numbers between 1 and 100 are \n”); for(i=1; i<=100; ++i){ rem = i % 2; if(rem != 0) printf(“\n  %d”,i); } return 0; }  

C program to display the odd digits present in integer

C program to display the odd digits present in integer

C program to display the odd digits present in integer Odd number can not be divided by 2. The remainder after dividing an Odd number by 2 is one. For example . . . Odd digits of number 6547 are 5 and 7. #include<stdio.h> int main(){ int num,rem,odd=0,digit; printf(”  Enter an integer number: “); scanf(“%d”,&num); … Read more

C program to print diamond pattern

C program to print diamond pattern #include <stdio.h> int main() { int i, j, rows, space = 1; printf(“Please enter number of rows you want to see in half Diamond\n”); scanf(“%d”, &rows); printf(“Diamond pattern:\n”); space = rows – 1; for (j = 1; j <= rows; j++) { for (i = 1; i <= space; … Read more

PSEB 10th Result 2020: पंजाब बोर्ड पीएसईबी 10वीं का रिजल्ट जारी

pseb result 2020

PSEB 10th Result 2020: पंजाब बोर्ड पीएसईबी 10वीं का रिजल्ट जारी, ये रहा Direct Link http://punjab-10th-result.indiaresults.com/pb/pseb/class-10th-exam-result-2020/query.htm PSEB 10th Result 2020: पंजाब स्कूल एजुकेशन बोर्ड (पीएसईबी) ने 10वीं बोर्ड परीक्षा रिजल्ट जारी कर दिया है। 10वीं के साथ साथ 5वीं और 8वीं कक्षा का रिजल्ट भी जारी किया गया है। पंजाब बोर्ड ने 10वीं का रिजल्ट … Read more

C Program to convert uppercase string to lowercase string

C Program to convert uppercase string to lowercase string

C Program to convert uppercase string to lowercase string Program Logic: The logic we have used in the program is: All the upper case characters (A-Z) have ASCII value ranging from 65 to 90 and their corresponding lower case characters (a-z) have ASCII value 32 greater than them. For example ‘A‘ has a ASCII value … Read more