• Like
  • Save
ภาษา C
Upcoming SlideShare
Loading in...5
×

ภาษา C

  • 546 views
Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
546
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. 1. > ? 1. 3. 2. 4.2. < ? 1. 3. 2. 4.3. ? 1. 3. 2. 4.4. <= ? 1. 3. 2. 4.5. >= ? 1. 3. 2. 4. C 6-10#include <stdio.h>#include <conio.h>void main ( ) {int X ;float Y ; Char A, B ; Z, Ans :boolean;clrscr ( );
  • 2. X == 5; Y == 23.67; A == W); B == c); Z == true;Ans == (X<>Y) and (A < B);printf ("%d", Ans);Ans == (Y>==X) and not (X<>Y);printf ("%d", Ans);Ans == (A<>B) or (X<==Y);printf ("%d", Ans);Ans == (X<>Y) and (A > B);printf ("%d", Ans);Ans == (Y>==X) or (X<>Y);printf ("%d", Ans);getch ( );} W 87 c 996. X <> Y) and (A < B) ? 1. 3. 2. 4.7. Y>=X) and not (X <>Y) ? 1. 3. 2. 4.8. A <> B) or (X < =Y) ?
  • 3. 1. 3. 2. 4.9. X <> Y) and (A > B) ? 1. 3. 2. 4.10. Y >= X) or (X <> Y) ? 1. 3. 2. 4. 11-12#include <stdio.h>#include <conio.h>void main ( ) {IntNum1 ; Float Num2 ; Char Ch ; String Str ; Num1 == 23 ; Num2 == 0.97 ;Ch == z ;Str == Great ! ;printf ("Num1 = ", Num1) ;printf ("Num2 = ", Num2) ;printf ("Ch = ", Ch) ;printf ("Str = ", Str) ;
  • 4. getch ( ) ;}11. printf (Str = , Str); ? 1. 23 3. z 2. 0.97 4. Great !12. Runprintf ? 1. Number 2. String 3. 4. 13-15#include <stdio.h>#include <conio.h>void main ( ) {IntNum1 ; Float Num2 ; Char Ch ; String Str ;Clrscr; Num1 == 23; Num2 == 0.97;Ch == "z";Str == "Great !";
  • 5. printf ("Num1 = ", Num1);printf ("Num2 = ", Num2);printf ("Ch = ", Ch);printf ("Str = ", Str);getch ( );}13. printf ("Ch = ", Ch); ? 1. 0.97 3. z 2. 23 4. Great !14. printf ("Num2 = ", Num2); ? 1. 0.97 3. 23 2. 22.03 4. 23.9715. Runprintf ? 1. Number 2. String 3. 4. 16-17#include <stdio.h>#include <conio.h>void main ( ) {int Number ;
  • 6. ClrScr;printf ("Enter an integer number : ");scanf ("%d", Number);printf ("You entered ", Number);scanf ("%d", Number);getch ( );}16. Printf 7 ? 1. = 3. := 2. => 4. ;=17. Scanf 10 ? 1. Single Quote 3. Comma 2. Double Quote 4. Semi Colon 18-20#include <stdio.h>#include <conio.h>void main ( ) {
  • 7. IntNum1 ; Float Num2 ; String Name ;Clrscr ;printf ("Enter your name : ") ;scanf ("%C", Name) ;printf (Enter your age and salary : ) ;scanf ("%C",Num1) ;scanf ("%C",Num2) ;printf (Your name is , Name) ;printf (You are , Num1, years old.) ;printf (Your salary , Num2:2:2) ;getch ( ) ;}18. ReadLn 9 ? 1. 3. Num1 Num1 2. 4. Name Name19. WriteLn 13 ? 1. 3. Num1 Num1 2. 4. Name Name
  • 8. 20. 15 Num2:2:2 ? 1. Num2 2 2 2. Num 2 2 3. Num2 2 4. Num 2 Variables)21. Float A, B ; A B ? 1. 3. 2. 4.22. 10, 12, 0 ? 1. Number 3. Char 2. Float 4. String23. int A , B ; A B ? 1. Integer 3. Char 2. Float 4. String24. Double A, B ; A B ? 1. 3. 2. 4.25. Char A, B ; A B ? 1. 3. 2. 4. 6-10
  • 9. #include <stdio.h>#include <conio.h>void main( ){ A = 3; B = 15; C = 12; D = 8;printf ("A+B+C =", A+B+C);printf ("A+(B-C) =", A+(B-C));printf ("(D-A)-2 =", (D-A)-2);printf ("B DIV A =", B DIV A);printf ("C MOD D =", C MOD D);getch ( );}26. A+B+C = ? 1. 30 3. 3 2. 6 4. ABC27. A+(B-C) = ? 1. 30 3. 3 2. 6 4. A+(B-C)28. (D-A) - 2 = ? 1. 30 3. 3 2. 6 4. (D-A) - 2
  • 10. 29. B DIV A = ? 1. 30 3. 5 2. 6 4. 330. C MOD D = ? 1. 30 3. 3 2. 4 4. 1 1-1031. ? 1. If... 3. switch...else 2. If...else 4.32. ? 1. 3. 2. 4.33. case switch ? 1. break 3. while 2. { } 4. include34. ? 1. for 3. while 2. do-while 4. If....else35. ? 1. continue 3. break 2. switch 4.
  • 11. 36. case switch ? 1. break 3. while 2. { } 4. include37. 6? 1. if 3. do.....while 2. default 4.38. switch ? 1. break 3. default 2. else 4. case39. ? 1. case 1 : 3. case num + 7 2. if (ch== Y +1) 4.40. if ? 1. if (sale >=100000 <= 500000) Commission 0.025 2. if (sale >=100,000 and sales 500,000) Commission 2.5% 3. if (sale >=200000 && sales 500000) Commission 0.050 4. if (sale between 100000 to 500000) Commission 0.025