Tag Archives: string

Auto_UrlOpener


Language: C++

#include<iostream>
#include<fstream>
#include <stdlib.h>
#include<string.h>
#include<windows.h>
void welcome(void);
void thanks(void);
using namespace std;
int main()
{
char file;
char s;
welcome();
printf(“Are you sure to run this? Y/Nn”);
scanf(“%c”,&file);

ifstream shadhin(“links.txt”);
char link[5000];
if(file==’y’ || file==’Y’)
{
if(shadhin==”)
{
cout<<“nn”links.txt” file missing.!!! First close the progarm then Put the file and run again.n”;
cout<<“Press CTRL+Z then Enter to exit.”<<endl;
cin>>s;
return 0;
}
cout<<“nProgram is now runnig…………………..”<<endl;
while(shadhin>>link)
{
ShellExecute(NULL, “open”, link,
NULL, NULL, SW_SHOWNORMAL);
Sleep(5000);
}
cout<<“nWork is done.”;
}else if(file==’n’ || file==’N’){
cout<<“nThank you! Best of luck for next time.n”<<endl;
}else{
cout<<“Oops!!!!!! You enter invalid key.Run again and give right key.”<<endl;
}
shadhin.close();
thanks();
cout<<“Press CTRL+Z then Enter to exit.”<<endl;
cin>>s;

return 0;

}
void welcome(void)
{
cout<<“Welcome!This is an auto urls opener program that Developed by H.R.Shadhin”<<endl;
cout<<“=====================>(@Z! C0d3r<==================nn”<<endl;
}
void thanks(void)
{
cout<<“nn************************************************”<<endl;
cout<<“Thank you for useing this program.”<<endl;
cout<<“Give feedbacks on:www.crazicoder.wordpress.com”<<endl;
cout<<“E-mail:hrshadhin.i386[AT]gmail[DOT]com or Facebook:”<<endl;
cout<<“www.facebook.com/crazicoder”<<endl;
cout<<“nn************************************************”<<endl;
}

Advertisements

Write a program that will read names of three students from user


#include<stdio.h>
#include<string.h>
int main()
{

int i;
char sname[3][40];
char yourname[40];
for(i=0;i<3;i++)
{
printf(“Enter the name of the student:n”);
gets(yourname);
strcpy(sname[i],yourname);
}
for(i=0;i<3;i++)
{
puts(sname[i]);

}
return 0;
}