Write a program to enter mark of 6 different subjects and find out the total marks(using cin and cout statement)

c++ programs                                                                                                  notes of c++

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int sub1,sub2,sub3,sub4,sub5,sub6,total;

cout<<"enter marks of sub1";

cin>>sub1;

cout<<"enter marks of sub2 ";

cin>>sub2;

cout<<"enter marks of sub3";

cin>>sub3;

cout<<"enter marks of sub4";

cin>>sub4;

cout<<"enter marks of sub5";

cin>>sub5;

cout<<"enter marks of sub6";

cin>>sub6;

total=sub1+sub2+sub3+sub4+sub5+sub6;

cout<<"total marks is:"<<total;

getch();

}

Download PDF OF C++ Notes

Post a Comment

0 Comments