C Questions Answers-C language basic syntax(PartII)


C language basics (PartII)

1. Find any errors in the following C program:
void main(){ /* This is the main function
printf('Learning C Programming language is fun.');

}
Check answer 2. Find any errors in the following C program:
void main(){ // This is the main function
integer a;
float b;

}
Check answer 3. Find any errors in the following C program:
int main(){ // This is another C program with some errors
a,b,s int;
d float;
printf("The end of the program");
return 0;
}
Check answer 4. What is the output from the following C program?
int main(){ // This is another C program with some errors
int a,b,sum,subtr;
a=100;
b=20;
sum=a+b;
subtr=a-b;
printf("%-5s%-5s\n","a+b","a-b");
printf("%-5d%-5d",sum,subtr);
}
Check answer


Comments

mohan comment

 mohan

it is nice


2017-02-13



This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.