C++ Program to find the Marks Percentage

#include #include int main() { clrscr(); float sub1,sub2,sub3,sub4,sub5,perc,total; cout<<“\n\t Enter the Marks obtained in 5 Subjects:”; cin>>sub1>>sub2>>sub3>>sub4>>sub5; total=sub1+sub2+sub3+sub4+sub5; perc=(total/500)*100; cout<<“\n The Percentage marks are:”<<perc<<“%”; return 0; }

C++ Program to Display ASCII code of a Character

#include #include #include int main() { clrscr(); char val; cout<<“\n\t Enter the Character:” gets(val); char ch=val;  //assign ASCII code for val to ch int num=ch;   //store same code in an int cout<<“\n\t The ASCII code for”<<ch<<“is”<<num<<“\n”; ch=ch+1; num=ch; cout<<“\n\t The ASCII code for”<<ch<<“is”<<num<<“\n”; return 0; }

A Simple Graphics Program in C++

#include #include #include void main() { int gd,gm,i; gd=0; gm=0; initgraph(&gd,&gm,” “); setcolor(GREEN); setlinestyle(0,1,1); rectangle(100,100,200,200); setlinestyle(2,1,3); rectangle(200,200,400,400); getch(); closegraph(); }