#include<iostream> using namespace std; class student{ public: string c[4]; float percentage[4]; int range; void setstudentinfo(){ cout<<“enter number of student whose record you want to save \n”; cin>>range; for(int k=0;k<range;k++){ cout<<“\n enter name and regno”<<k+1; cin>>c[k];} for(int k=0;k<range;k++){ cout<<“\n enter percentage of student”<<k+1; cin>>percentage[k]; } } void getstudentinfo(){ for(int k=0;k<range;k++){ cout<<“\nstudent is\n”<<k+1<<“regno and name is\n”<<c[k]; if(percentage[k]>=70){ […]
#include<iostream> using namespace std; int main(){ float percentage[40]; int number=0; int *ptrtoarray; cin>>number; ptrtoarray=new int[number]; return 0; }
#include<iostream> using namespace std; int main(){ int array[3]={10,11,12}; int *aptr; aptr=array; for(int i=0;i<3;i++){ cout<<*aptr+i<<endl; } return 0; }