#include<bits/stdc++.h> using namespace std; //10.function void myData(){ printf("RajoMay Data Loading..."); cout<<"***"; } int myData(int a){ return a*100; } int main(){ //1.print on console cout<<"Rajomay"; printf("Rajomay"); //support both printf & cout //_____________________________________________________________________________________________________________ //2.Taking input int a; cin>>a; cout<<"your entered no. : "<< a; //_____________________________________________________________________________________________________________ //3.Data type short a1;//2bytes 5digit int a2; //4bytes 10digit long a3; //8bytes long long int a4; //8bytes float b1;//4bytes double b2;//8bytes char a = 'a'; char b[] = "rajomay"; string c = "Tanmay Rajoshree"; bool a = false ; //%b //_____________________________________________________________________________________________________________ //4B.multiline input cin>>a2>>b1>>a>>b>>c; cout<< a2<<" "<< b1<<" "<< a<<" "<< b<<"\n"<< c; //_____________________________________________________________________________________________________________ //5.multiline string input getline(cin,c); getline(cin,c,';'); //with next line and press ; to get output cout<< c; //_____________________________________________________________________________________________________________ //6.if/else if(a){ cout<<"yes"; } else{ cout<<"NA"; } //_____________________________________________________________________________________________________________ //7.switch case (Note-: cannot pass string case " ") switch(true){ case 1: printf("num"); break; case 'a': cout<<"char"; break; default: printf("NA"); } //_____________________________________________________________________________________________________________ //8.for loops for(int i=1;i<=10;i++){ cout<< i<<" "; } //_____________________________________________________________________________________________________________ //9.while and do-while loop int i=44; while(i < 10){ cout<< i<<" "; i++; } //-------------------------- do{ cout<< i<<" "; i++; }while(i < 10); //_____________________________________________________________________________________________________________ //10.function myData(); printf("%d",myData(2)); _____________________________________________________________________________________________________________ //11.Typecasting int i = 17; double d; char c; char ac[10]; string acc; d = (double) i; c = (char) i; itoa(i,ac,10); acc = to_string(i); cout<< d << c << ac << acc ; //_____________________________________________________________________________________________________________ return 0; }