31. What are symbolic constants? How are they defined? Symbolic constants, conventionally written in uppercase, are the names which substitute a sequence of character that cannot be changed. The character may be a numeric constant, a character constant, or a …
21.How can we calculate the range of any data type? What is the size and range of signed int, float, long double? General form for the range calculation is given by Lower limit = -2n-1 Upper limit = +2n-1 – 1; Where n …
1. Define software. Explain different types of software. Software is a collection of machine readable instructions that directs a computer to perform some specific tasks. It is an ordered sequence of instructions given for changing the state of the computer …
Presentation on Decision making and Branching Introduction C language possesses such decision making capabilities by supporting the following statements: • if statement • switch statement • Conditional operator statement • goto statement The conditional branching statements help to jump from …
Chapter – 2 Introduction to C C is a general-purpose, structured programming language. Its instructions consists of terms that resemble algebraic expression, augmented by certain English keywords such as if, else, for, do and while, etc. C contains additional features …
Chapter – 1 Problem Solving using Computer What is a problem? Problem is defined as the difference between an existing situation and a desired situation, that is, in accordance with calculation; a problem is numerical situation and has complex form. …
#include <conio.h>#include <stdio.h>void main(){ int m, n, c, d, matrix[10][10], transpose[10][10]; clrscr(); printf(“Enter the number of rows and columns of matrix “); scanf(“%d%d”,&m,&n); printf(“Enter the elements of matrix n”); for( c = 0 ; c < m ; c++ ) …
#include <stdio.h>#include <conio.h>#include <stdlib.h>#include <ctype.h>void main(){ int i,j=0,l=0,p[50],pos,n; char str[50],substr[50],dir[6],dir1[4]=”left”,k; clrscr(); printf(“nnEnter a string:”); scanf(“%s”,str); printf(“nEnter position, no. of character direction of sub string:”); scanf(“%d%d%s”,&pos,&n,dir); for(i=0;str[i]!=”;i++) l++; for(i=0;dir[i]!=”;i++) { if(toupper(dir[i])==toupper(dir1[i])) k=’l’; else { k=’r’; break; } } if(toupper(k)==’L’) { if(pos==0||(pos-n)<0) …
// program to test palindrome number#include <stdio.h>#include <conio.h>#include <math.h>void main(){ int n,dig,rev=0,temp; clrscr(); printf(“Enter a number:”); scanf(“%d”,&n); temp=n; while(temp!=0) { dig=temp%10; rev=rev*10+dig; temp=temp/10; } printf(“nnThe reverse of %d is %d”,n,rev); if(rev==n) { printf(“nn%d is palindrome”,n); } else { printf(“nn%d is …
