C is a general-purpose high level language that was originally developed by Dennis Ritchie for the Unix operating system. It was first implemented on the Digital Eqquipment Corporation PDP-11 computer in 1972. The Unix operating system and virtually all Unix applications are written in the C language. C has now become a widely used professional … Continue reading Introduction to C Language
Programmer
Chapter 5 Programming Exercise [ANSI C]
Programming in ANSI C Chapter-05 Programming Exercises 5.1: Write a to determine whether a given number is “odd” or “even” and print the message NUMBER IS EVEN or, NUMBER IS ODD. (a) without using else option, (b) with else option. (a) Solution: #include <stdio.h> int main() { int num; printf("Enter the number="); … Continue reading Chapter 5 Programming Exercise [ANSI C]
Chapter 4 Programming Exercise [ANSI C]
Problem no. 4.1:Given the string“WORDPROCESSING”, Write a program to read the string from the terminal and Display the same in the following format: (a)WORD PROCESSING (b)WORD PROCESSING (c) W.P. Solution: #include <stdio.h> int main() { char s[10], d[11]; printf("enter the string="); scanf("%4s%10s",s,d); printf("(a)%s %s\n",s,d); printf("(b)%s\n%s\n",s,d); printf("(c)%.1s.%.1s",s,d); return 0; } Problem no. … Continue reading Chapter 4 Programming Exercise [ANSI C]