Skip to Main Content
Xpress Learning - Computer Fundamentals of Programming an IT by Pearson
book

Xpress Learning - Computer Fundamentals of Programming an IT by Pearson

by Ashok N. Kamthane, Rohit Khurana
May 2024
Beginner to intermediate content levelBeginner to intermediate
465 pages
16h 14m
English
Pearson India
Content preview from Xpress Learning - Computer Fundamentals of Programming an IT by Pearson
II-150 Programming Concepts
7. Factorial of 5
void main()
{
int i,m=1,num[5]={1,2,3,4,5};
clrscr();
for(i=0;i<=4;i++)
m=m*num[i];
printf("Total is %d ",m);
getche();
}
OUTPUT:
120
8. Arrange numbers in ascending order
void main()
{
int i,k,temp,num[6]={4,6,8,3,2,10};
clrscr();
for(i=0;i<=5;i++)
{
for(k=i+1;k<5;k++)
{
if(num[i]>num[k])
{
temp=num[i];
num[i]=num[k];
num[k]=temp;
}
}
}
for(i=0;i<6;i++)
printf("\n %d",num[i]);
getche();
}
OUTPUT:
2
3
4
6
8
10
M07_ITL-ESL4791_02_SE_C07.indd 150 12/22/2012 5:03:01 PM
Array II-151
9. Reversing text and a number
void main()
{
char name[7]
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Express Learning - Computer Fundamentals and Programming

Express Learning - Computer Fundamentals and Programming

Ashok Kamthane, ITL ESL
Windows® Internals, Sixth Edition, Part 2

Windows® Internals, Sixth Edition, Part 2

David A. Solomon Mark E. Russinovich and Alex Ionescu

Publisher Resources

ISBN: 9781299954878