E.Balagurusamy C PROGRAMMING EXERCISE SOLUTION :CHAPTER-2


REVIEW   QUESTIONS STATE WHETHER THE FOLLOWING STATEMENTS ARE  TRUE OR FALSE: (a)   Any valid printable ANSII character can be used in an identifier. ( False ) (b)   All variables must be given a type when they are declared. ( True ) (c)    Declarations can appear anywhere in a program. ( False ) (d)    ANSI C treats the variable name and Name…

SOLUTION PROGRAMMING IN ANSI C: CHAPTER-1


Problem exercise no 1.1&1.2: Coding of the programme: #include<stdio.h> #include<conio.h> void main() { clrscr(); printf(“—————————————\n”); printf(“I  First line :A.Z.M.Shakilur Rahman  I\nI  Second line :12/a ,Ali sonar lane  I\nI  Third line:Bogra,5800              I\n”); printf(“—————————————“); getch(); } Output: Problem exercise no. 1.3: Coding of the programme: #include<stdio.h> #include<conio.h> void main() {clrscr(); printf(“*\n* *\n* * *\n* * * * “); getch(); } Output: * *…

Adding/subtract/multiply/divide three number with programming C


Adding three number: /* we  going to make a program with programing  C . At first the program asked the user for the three number. After getting the number the program will show the addition of those three number.*/ #include <stdio.h> int main() { int x,y,z,result; printf(“Enter the 1st number: “); scanf(“%d”,&x); printf(“Enter the 2nd number:…

Simple program in Programming C


C programming code for adding three numbers: #include<stdio.h> void main() { int a, b, c,d; printf(“Enter three numbers to add\n”); scanf(“%d%d%d”,&a,&b,&c); d=a+b+c; printf(“result = %d\n”,d); return 0; } for minus #include<stdio.h> main() { int a, b, c,d; printf(“Enter three numbers to subtraction\n”); scanf(“%d%d%d”,&a,&b,&c); d=a+b-c; printf(“result = %d\n”,d); return 0; } C programming code for multiplication  three numbers: #include<stdio.h>…

Programming C Conditionals


This Chapter deals with the various methods that C can control the flow of logic in a program. Apart from slight syntactic variation they are similar to other languages. As we have seen following logical operations exist in C:     ==, !=, , &&.  One other operator is the unitary – it takes only one argument – not !.  These operators…