answersLogoWhite

0

just include #define next to #include

or
/*just follow the pattern below*/ example:






#include
#include
#define pf printf
#define sf scanf
void main
{
int number

pf("Enter a value:");
sf("%i",&number);

getch();
}

User Avatar

Wiki User

∙ 17y ago
User Avatar

What else can I help you with?

Continue Learning about Engineering

What types of database exist in c plus plus?

#include <stdio.h> main() { FILE *a; int sno,tm,em,mm,scm,sm,hm; char sname[20],any[1]; clrscr(); a=fopen("student.dat","a"); do { printf("Enter Student Number : "); scanf("%d",&sno); printf("Enter Student Name : "); scanf("%s",sname); printf("Enter Telugu Marks : "); scanf("%d",&tm); printf("Enter English Marks : "); scanf("%d",&em); printf("Enter Maths Marks : "); scanf("%d",&mm); printf("Enter Science Marks : "); scanf("%d",&scm); printf("Enter Social Marks : "); scanf("%d",&sm); printf("Enter Hindi Marks : "); scanf("%d",&hm); fprintf(a,"%d %s %d %d %d %d %d %d\n",sno,sname,tm,em,mm,scm,sm,hm); printf("Do you wish to continue(Y/N)"); scanf("%s",any); }while(strcmp(any,"y")==0); fclose(a); }


C program to create symbol table?

#include #include #include #include void main() { int i,j,k,n,add=0,size; char c,in[20],temp[20],val[20],var[20]; FILE*fp; clrscr(); fp=fopen("input.c","r"); c=getc(fp); printf('\n THE INPUT FILE IS:") while(!feof(fp)) { { printf("%c",c); c=getc(fp); } fclose(fp); printf("\n**************symbol table**************"); printf("\n DAta type\tName\tNo.of Elements\tSize\tAddress"); printf("************************************"); while(!feof(fp)) { if(isalpha(c)) { i=0; do { temp[i==]=c c=getc(fp); }while(isalpha(c)); temp[i]='\0'; if(strcmp("int",temp)==0) { strcpy(val," "); strcpy(in," "); strcpy(var," "); while(c!=';') { strcpy(val," "); c=getc(fp); i=0; do { var[i++]=c; c=getc(fp); }while(isalpha(c)); var[i]='\0'; if(c=='[') { i=0; c=getc(fp); strcpy(in," ") do { in[i++]=c; c=getc(fp); k=atoi(in); size=size*k; } else { strcpy(in,'1'); size=2; } if(c=='=') c=getc(fp); i=0; do { val[i++]=c; c=getc(fp); }while(c!=','&&c!=';') val[i]='\0'; } printf("\n%s\t\t%s\t%s\t\t%s\t%dBytes\t%d",temp,var,val,in,size,add); add=add+size; } } } else c=getc(fp); } getch(); }


Write a function that print a triangle of stars?

Function to print star triangle in c++#include#includevoid starfunction(int); //You can give any function namevoid main(){int a;clrscr();couta;star(a);getch();}void starfunction(int r ){for(int i=1;i


C program to multiply two numbers without using arithmetic operator and using recursive function?

# include<stdio.h> main() { int a,b,i: int result=0; printf("enter two numbers to be multipied"); scanf("%d%d",&A,&B); for(i=1;i<=b;i++) result=result+A; printf("%d*%d=%d\n",a,b,result); }


How do you implement stack using singly linked list?

struct node { int info; struct node *link; } *top=NULL; int main() { int choice; while(1) { printf("1.Push\n"); printf("2.Pop\n"); printf("3.Display\n"); printf("4.Quit\n"); printf("Enter your choice : ") ; scanf("%d", &choice); switch(choice) { case 1: push(); break; case 2: pop(); break; case 3: display(); break; case 4: exit(1); default : printf("Wrong choice\n"); }/*End of switch */ }/*End of while */ return 0; }/*End of main() */ void push() { struct node *tmp; int pushed_item; tmp = malloc(sizeof(struct node)); printf("Input the new value to be pushed on the stack : "); scanf("%d",&pushed_item); tmp->info=pushed_item; tmp->link=top; top=tmp; }/*End of push()*/ void pop() { struct node *tmp; if(top == NULL) printf("Stack is empty\n"); else { tmp=top; printf("Popped item is %d\n",tmp->info); top=top->link; free(tmp); } }/*End of pop()*/ void display() { struct node *ptr; ptr=top; if(top==NULL) printf("Stack is empty\n"); else { printf("Stack elements :\n"); while(ptr!= NULL) { printf("%d\n",ptr->info); ptr = ptr->link; }/*End of while */ }/*End of else*/ }/*End of display()*/

Related Questions

What types of database exist in c plus plus?

#include <stdio.h> main() { FILE *a; int sno,tm,em,mm,scm,sm,hm; char sname[20],any[1]; clrscr(); a=fopen("student.dat","a"); do { printf("Enter Student Number : "); scanf("%d",&sno); printf("Enter Student Name : "); scanf("%s",sname); printf("Enter Telugu Marks : "); scanf("%d",&tm); printf("Enter English Marks : "); scanf("%d",&em); printf("Enter Maths Marks : "); scanf("%d",&mm); printf("Enter Science Marks : "); scanf("%d",&scm); printf("Enter Social Marks : "); scanf("%d",&sm); printf("Enter Hindi Marks : "); scanf("%d",&hm); fprintf(a,"%d %s %d %d %d %d %d %d\n",sno,sname,tm,em,mm,scm,sm,hm); printf("Do you wish to continue(Y/N)"); scanf("%s",any); }while(strcmp(any,"y")==0); fclose(a); }


Source code of love meter in c-programming?

/* LOVE METER */#include#includevoid predict(void);void main(){char n;clrscr();predict();printf("\n\nAre you want to check again with another partner\n");scanf("%s",&n);if(n=='y'){predict();}printf("\n\n\n****Thank You****\n\n\n");printf("\t\t\t\t\t@sawan soft.");getch();}void predict(void){char a[25],b[25];int m,n,l,i,j;printf("****Welcome to prediction game ****\n");printf("\n******Enter your name******\n");scanf("%s",a);for(i=0;a[i]!='\0';i++){b[i] =a[i];}printf("\n\n******Enter your partner name******\n");scanf("%s",b);for(j=0;b[j]!='\0';j++){a[j]=b[j];}l=i+j;if(l==1l==7l==13l==19){printf("\n****FREIND****\n");printf("\nyou will be freind not so more....");}if(l==2l==8l==14l==20){printf("\n****LOVE****\n");printf("\nYou can sucess own love....");}if(l==3l==9l==15l==21){printf("\n****AFFECTION****\n");printf("\nyou are in attraction, tell your heart felling soon....");}if(l==4l==10l==16l==22){printf("\n****MARRIAGE****\n");printf("\nYou got sucess in love....");}if(l==5l==11l==17l==23){printf("\n****ENEMY****\n");printf("\nKeep distance from them....");}


C program to create symbol table?

#include #include #include #include void main() { int i,j,k,n,add=0,size; char c,in[20],temp[20],val[20],var[20]; FILE*fp; clrscr(); fp=fopen("input.c","r"); c=getc(fp); printf('\n THE INPUT FILE IS:") while(!feof(fp)) { { printf("%c",c); c=getc(fp); } fclose(fp); printf("\n**************symbol table**************"); printf("\n DAta type\tName\tNo.of Elements\tSize\tAddress"); printf("************************************"); while(!feof(fp)) { if(isalpha(c)) { i=0; do { temp[i==]=c c=getc(fp); }while(isalpha(c)); temp[i]='\0'; if(strcmp("int",temp)==0) { strcpy(val," "); strcpy(in," "); strcpy(var," "); while(c!=';') { strcpy(val," "); c=getc(fp); i=0; do { var[i++]=c; c=getc(fp); }while(isalpha(c)); var[i]='\0'; if(c=='[') { i=0; c=getc(fp); strcpy(in," ") do { in[i++]=c; c=getc(fp); k=atoi(in); size=size*k; } else { strcpy(in,'1'); size=2; } if(c=='=') c=getc(fp); i=0; do { val[i++]=c; c=getc(fp); }while(c!=','&&c!=';') val[i]='\0'; } printf("\n%s\t\t%s\t%s\t\t%s\t%dBytes\t%d",temp,var,val,in,size,add); add=add+size; } } } else c=getc(fp); } getch(); }


Write a function that print a triangle of stars?

Function to print star triangle in c++#include#includevoid starfunction(int); //You can give any function namevoid main(){int a;clrscr();couta;star(a);getch();}void starfunction(int r ){for(int i=1;i


C program to multiply two numbers without using arithmetic operator and using recursive function?

# include<stdio.h> main() { int a,b,i: int result=0; printf("enter two numbers to be multipied"); scanf("%d%d",&A,&B); for(i=1;i<=b;i++) result=result+A; printf("%d*%d=%d\n",a,b,result); }


Where can you write your own lyrics?

I write them in my diary.


How do you write a c program to compute 2 to the power of x?

First of all you need to find the right function. And the right function for this job is power() which is located in math.h. Now you need to ask user to enter "x" value and you can compute power(2, x).Here is a small example of such application:#include #include int main() {int power = 0;printf("Enter the power: ");scanf("%d", &power);printf("2^power: %llu\n", (long long)pow(2, power));return 0;}It is still limited, only capable of giving results with x up to ~60. Because of long long type, which is the biggest of all. To get even bigger number you would need to write your own data structures for numbers and write power() function for them.Testing:Enter the power: 322^power: 4294967296Note:This code is only for example, it does not meat ANSI C90 criteria. (long long type is not supported by ASNI C90). Other than that it is working.


What is the ISBN of In His Own Write?

The ISBN of In His Own Write is 0684868075.


Who wrote in his own write?

John Lennon wrote In His Own Write.


How many pages does In His Own Write have?

In His Own Write has 80 pages.


What is meant by functions on python?

Python programming allows you to write your own programs. For example, to write a function named double that returns the number that you input, but doubled, we would write the following (where >>>> indicates a tab space) def double(x): >>>>x=x*2 >>>>return x


Does escape the fate write their own music?

Yes, they write their own material.