Skip to main content

Posts

Featured

C++ Programming All Notes.....

 1.WAP to add 1 to n number without using formula. Source code:- #include<iostream> #include<conio.h> using namespace std; int main() { int i,n,sum=0; cout<<"\n Enter the nth number:-"; cin>>n; for(i=0;i<=n;i++) { sum=sum+i; } cout<<"sum is:-"<<sum; getch(); } Output:-  Enter the nth number:-10  sum is:-55 //<---------------------------------------------------------------------------->// 2.  WAP Addition of two matrix. Source code:- #include<iostream> #include<conio.h> using namespace std; int main() { int a[3][3],b[3][3],c[3][3],i,j; cout<<"\n Enter the 9 number for a:-"; for(i=0;i<3;i++) { for(j=0;j<3;j++) { cin>>a[i][j]; } } cout<<"\n Enter the 9 number for b:-"; for(i=0;i<3;i++) { for(j=0;j<3;j++) { cin>>b[i][j]; } } for(i=0;i<3;i++) { for(j=0;j<3;j++) {

Latest Posts

UEM Quiz Game Using C++ Programming