The document describes a type checking C program that takes user input for variables a and b, determines if they are of type "int" by calling the type() function, and checks for a type error if their types do not both equal "int". The program prompts the user to enter values for variables a and b, calls type() to get the type of each in a message string, prints the types, and checks for a type match or error.
The document describes a type checking C program that takes user input for variables a and b, determines if they are of type "int" by calling the type() function, and checks for a type error if their types do not both equal "int". The program prompts the user to enter values for variables a and b, calls type() to get the type of each in a message string, prints the types, and checks for a type match or error.
#include <stdio.h> #include <conio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> char* type(char[],int); void main() { char a[10],b[10],mess[20],mess1[20]; int i,l; clrscr(); printf( "\n\n int a,b;\n\n int c=a+b\n"); printf( "\n\n Enter a value for a\n"); scanf("%s", a); l=strlen(a); printf(" \n a is :"); strcpy(mess,type(a,l)); printf("%s",mess);