Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

1. What is language ?

2. what is the need of communication ?


3. what do you mean by programming language and its need ?

4. what is meaning by computer programming language ?


Ans. C is a genral purpose compiler based High level lanuage.
i.with C we can develop Operating system.
ii.Editor software.
iii.Design compilers
iv.Gaming applications
v.Application software

5. different kind of application


standard alone application
web applincation
network, Gaming
6. #include<stdio.h>
main()
{
printf("hello")
}

#include <stdio.h>
#include <stdlib.h>
struct node{
int item;
struct node* left;
struct node* right;
};
//In order traversal
void inorderTraversal(struct node* root){
if (root == NULL) return;
inorderTraversal(root->left);
printf("%d->", root->item);
inorderTraversal(root->right);
}
//preorder traversal
void preorderTraversal(struct node* root){
if (root == NULL) return;
printf("%d ->", root->item);
preorderTraversal(root->left);
preorderTraversal(root->right);
}
//postorder traversal
void postorderTraversal(struct node* root){
if (root == NULL) return;
postorderTraversal(root->left);
postorderTraversal(root->right);
printf("%d ->", root->item);
}
//create a new node
struct node* createNode(value){
struct node* newNode = malloc(sizeof(struct node));
newNode->item = value;
newNode->left = NULL;
newNode->right = NULL;
return newNode;
}
//insert on the left of the node
struct node* insertLeft(struct node* root, int value){
root->left = createNode(value);
return rooot->left;
}

46.
#include <stdio.h>
#include <stdlib.h>
struct node{
int item;
struct node* left;
struct node* right;
};
//In order traversal
void inorderTraversal(struct node* root){
if (root == NULL) return;
inorderTraversal(root->left);
printf("%d->", root->item);
inorderTraversal(root->right);
}
//preorder traversal
void preorderTraversal(struct node* root){
if (root == NULL) return;
printf("%d ->", root->item);
preorderTraversal(root->left);
preorderTraversal(root->right);
}
//postorder traversal
void postorderTraversal(struct node* root){
if (root == NULL) return;
postorderTraversal(root->left);
postorderTraversal(root->right);
printf("%d ->", root->item);
}
//create a new node
struct node* createNode(value){
struct node* newNode = malloc(sizeof(struct node));
newNode->item = value;
newNode->left = NULL;
newNode->right = NULL;
return newNode;
}
//insert on the left of the node
struct node* insertLeft(struct node* root, int value){
root->left = createNode(value);
return rooot->left;
}

int main(){
struct node* root = createNode(1);
insertLeft(root,2);
insertRight(root,3);
insertLeft(root->left,4);
insertRight(root->right,5);
insertLeft(root->left,6);
printf("Indorer traversal \n");
inorderTraversal(root);
printf("\n Predorer traversal \n");
preorderTraversal(root);
printf(" \nPostdorer traversal \n");
postorderTraversal(root);
}

You might also like