Preprocessor in 'C'
Programming Languages
by
2y ago
Preprocessor  : As the name suggests a processor which performs pre-processing or some processing on a program before submitting it for actual compilation is called preprocessor.  For example inclusion of header files in a program. Role of Pre-processor : Program written in C language is given to preprocessor.  Preprocessor checks of preprocessor directives if any present in given program. It performs specific actions according to directive instructions and submit modified code to the compiler.  Compiler then compiles it and produces object code which is then exec ..read more
Visit website
Assignment III - Basic 'C'
Programming Languages
by
4y ago
Assignment III Write a ‘C’ program to add two matrices of order m X n. Write a ‘C’ program to check if a n X n matrix is symmetric. Write a ‘C’ program to read a matrix and calculate the sum of its diagonal elements. Write a ‘C’ program to subtract two matrices of order m Xn. Write a ‘C’ program to read a matrix and display its transpose. Write a ‘C’ program to check if a matrix is upper triangular. Write a ‘C’ program with menu to perform the following operations on a character. 1. Check uppercase or lowercase 2. Display its ASCII value 3. Display its next and previous character 4. Exi ..read more
Visit website
‘C’ program to add two matrices of order m X n.
Programming Languages
by
4y ago
C File => /* Write a ‘C’ program to add two matrices of order mXn */ #include<stdio.h> int main()  {      int m,n,i,j,mat1[20][20];      int mat2[20][20],add[20][20];        printf("\n Enter no. of rows : ");      scanf("%d",&m);      printf("\n Enter no. of cols : ");      scanf("%d",&n);        printf("\n Input Matrix1 : \n");      for(i=0;i<m;i++)     {        for(j=0;j<n;j++)       ..read more
Visit website
‘C’ program to check if a matrix is upper triangular.
Programming Languages
by
4y ago
C File => /* Write a ‘C’ program to check if a matrix is upper triangular. */ #include<stdio.h> int main()  {      int i,j,r,c,mat[30][30],flag=1;        printf("\n Enter number of rows in matrix : ");      scanf("%d",&r);      printf("\n Enter number of cols in matrix : ");      scanf("%d",&c);     //Accepting matrix     for(i=0;i<r;i++)    {        for(j=0;j<c;j++)       {           pri ..read more
Visit website
‘C’ program with menu to perform operations on a character.
Programming Languages
by
4y ago
C File => /*Write a ‘C’ program with menu to perform the following operations on a  character.  1. Check uppercase or lowercase  2. Display its ASCII value  3. Display its next and previous character  4. Exit */ #include<stdio.h> #include<stdlib.h> #include<ctype.h> int main()  {      int ch;      char c;        printf("\n Enter any character : ");      scanf("%c",&c);      printf("\n Menu : \n1. Check uppercase or lowercase");      printf ..read more
Visit website
Menu driven program to perform operations on an integer.
Programming Languages
by
4y ago
C File => /* Write a menu driven program to perform the following operations on an  integer. Write separate functions.  1. Check if is even or odd  2. Check if it is prime  3. Exit */ #include<stdio.h> #include<stdlib.h> int main()  {       int n,ch,i;         void chk_even(int n)      {         if(n%2==0)            printf("\n Number is EVEN..");        else           printf("\n Number is ODD...");   ..read more
Visit website
Accept two numbers and perform the following operations till the user selects Exit.
Programming Languages
by
4y ago
C File => /* Accept two numbers and perform the following operations till the user selects Exit.  i. Maximum  ii. Display all numbers between the two  iii. Sum and average  iv. EXIT */ #include<stdio.h> #include<stdlib.h> int main()  {        int n1,n2,i,ch,sum;       float avg;         printf("\n Enter number1 : ");       scanf("%d",&n1);       printf("\n Enter number2 : ");       scanf("%d",&n2);         printf("\n Menu ..read more
Visit website
‘C’ program, which accepts annual basic salary of an employee and calculates and displays the Income tax
Programming Languages
by
4y ago
C File => /* Write a ‘C’ program, which accepts annual basic salary of an employee and calculates and displays the Income tax as per the following rules.   Basic: < 1,50,000 Tax = 0   1,50,000 to 3,00,000 Tax = 20%   > 3,00,000 Tax = 30% */ #include<stdio.h> int main()  {      int sal;      float tax;        printf("\n Enter basic salary : ");      scanf("%d",&sal);        if(sal<150000)          printf("\n Income ..read more
Visit website
‘C’ program to accepts a character and integer n as parameter and displays the next 'n' characters.
Programming Languages
by
4y ago
C File => /* Write a function in ‘C’, which accepts a character and integer n as parameter and displays the next 'n' characters. */ #include<stdio.h> int main()  {       int n,i;       char c;     // defining function        void disp_chars(char ch,int n)       {          for(i=1;i<=n;i++)          {              printf("%c\t",ch+1);              ch++;         ..read more
Visit website
‘C’ program to check if a n X n matrix is symmetric.
Programming Languages
by
4y ago
C File => /* Write a ‘C’ program to check if a nXn matrix is symmetric. */ #include<stdio.h> int main()  {      int mat[30][30],i,j,m,n,flag=1;            printf("\n Enter how many rows?");      scanf("%d",&m);      printf("\n Enter how many cols?");      scanf("%d",&n);      printf("\n Input matrix");      for(i=0;i<m;i++)     {         for(j=0;j<n;j++)        {       &nbs ..read more
Visit website

Follow Programming Languages on FeedSpot

Continue with Google
Continue with Apple
OR