Posts

Showing posts from June, 2018

C++ Program to subract 2 no.s

Image
#include<iostream> using namespace std; int main() {     int s1, s2 ,s;     cout <<"Subtraction Program \n";     cout <<"Enter value:- ";     cin >>s1;      cout <<"Enter value:- ";     cin >>s2;     s=s1-s2;     cout <<s;     return 0; }

C++ Program to add 2 integers

Image
#include<iostream> using namespace std; int main() {     int f1, f2, s;     cout <<"Enter a value:- ";     cin >> f1;     cout <<"Enter a value:- ";     cin >> f2;     s=f1+f2;     cout <<s;     return 0; }

C++ Program to print hello linux

Image
#include<iostream> using namespace std; int main() {     cout<<"hello linux";     return 0; }

File input/output program to access no. of character, spaces, tabs...

Image
By using File Input/Output , we gonna count:- No. of characters No. of blanks No. of tabs No. of lines So, here the code for the above. /*Pre Processors */ #include<stdio.h> #include<conio.h> int main()     /*Main function*/ {     FILE *fp;     char ch;     clrscr();     int nol=0, not=0, nob, noc=0;     fp=fopen("EMPLOYEE.TXT","r");     while(1)     {         ch=fgetc(fp);         if(ch==EOF)         break;         noc++;         if(ch==' ')         nob++;         if(ch=='\n')         nol++;         if(ch=='\t')         not++;...