Advertisement
Guest User

C tutorial submission example

a guest
May 16th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.90 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6.  
  7. /*
  8.  * File:   main.c
  9.  * Author: alp
  10.  *
  11.  * Created on May 15, 2019, 3:33 PM
  12.  */
  13.  
  14. #include <stdio.h>
  15. #include <stdlib.h>
  16.  
  17.  
  18. void task1(){
  19.     printf("Hello EDAII!");
  20. }
  21.  
  22. void task2(){
  23.     int a;
  24.     int b;
  25.     int sum;
  26.  
  27.     printf("Enter number 1:\n");
  28.     scanf("%d", &a);
  29.    
  30.     printf("You entered %d\n", a);
  31.    
  32.     printf("Enter number 2:\n");
  33.     scanf("%d", &b);
  34.    
  35.     printf("You entered %d\n", b);
  36.    
  37.     sum = a + b;
  38.            
  39.     printf("The sum is %d", sum);
  40. }
  41.  
  42. void task3(){
  43.     //...
  44. }
  45.  
  46. void task4(){
  47.     //...
  48. }
  49.  
  50. /*
  51.  *
  52.  */
  53. int main(int argc, char** argv) {
  54.  
  55.     //task1();
  56.     task2();
  57.     //task3();
  58.     //task4();
  59.    
  60.     return (EXIT_SUCCESS);
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement